Skip to content

Commit a6e3c07

Browse files
committed
added features table
Signed-off-by: Alexander Wert <alexander.wert@elastic.co>
1 parent ec02549 commit a6e3c07

File tree

18 files changed

+447
-35
lines changed

18 files changed

+447
-35
lines changed

.github/workflows/check-md-generation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.13'
21+
python-version: '3.12'
2222
- name: Install dependencies
2323
run: |
2424
cd docs/gen_edot_col_components

docs/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.PHONY: generate-collector-components
2-
generate-collector-components:
1+
.PHONY: generate
2+
generate:
33
cd gen_edot_col_components && pip install -r requirements.txt && python3 render_md.py
44

55
.PHONY: check-md-gen
@@ -19,5 +19,5 @@ check-links: build-site
1919
bundle exec htmlproofer --assume_extension '.html' --swap-urls '^/opentelemetry/:/' --ignore_urls '/http:\/\/localhost:4000.*/','/https:\/\/elastic.github.io\/opentelemetry\/*/','/https:\/\/mvnrepository.com\/artifact\/co.elastic.otel\/elastic-otel-javaagent.*/' --no_enforce_https ./_site
2020

2121
.PHONY: run-local
22-
run-local: generate-collector-components
22+
run-local: generate
2323
bundle exec jekyll serve

docs/_edot-collector/components.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ parent: Customization
1010
The EDOT Collector comes with embedded Collector components from the [OTel Collector Core](https://github.com/open-telemetry/opentelemetry-collector),
1111
[OTel Collector Contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) and the [Elastic Collector Components](https://github.com/elastic/opentelemetry-collector-components) repositories.
1212

13+
<!-- DO NOT DELETE THIS SECTION, TAGS ARE REQUIRED FOR GENERATION-->
1314
<!-- start:edot-collector-components-table -->
1415

1516
| Component | GitHub Repo | Version |

docs/_edot-sdks/android/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: EDOT Android
33
layout: default
4-
nav_order: 2
4+
nav_order: 7
55
---
66

77
## EDOT Android

docs/_edot-sdks/dotnet/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: EDOT .NET
33
layout: default
4-
nav_order: 5
4+
nav_order: 2
55
---
66

77
## EDOT .NET

docs/_edot-sdks/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Currently, the following EDOT SDKs are availble:
2626

2727
For languages for which Elastic does not offer its own distribution, we recommend using the upstream OTel SDKs:
2828

29-
| Language | Release Status |
29+
| Language | Upstream Docs |
3030
|:-------------------|:---------------|
3131
| JS / Browser | [Vanilla OTel RUM SDK/API](https://opentelemetry.io/docs/languages/js/) |
3232
| Rust | [Vanilla OTel Rust SDK/API](https://opentelemetry.io/docs/languages/rust/) |

docs/_edot-sdks/ios/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: EDOT iOS
33
layout: default
4-
nav_order: 5
4+
nav_order: 8
55
---
66

77
## EDOT iOS

docs/_edot-sdks/java/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: EDOT Java
33
layout: default
4-
nav_order: 5
4+
nav_order: 3
55
---
66

77
## EDOT Java

docs/_edot-sdks/nodejs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: EDOT Node.js
33
layout: default
4-
nav_order: 5
4+
nav_order: 4
55
---
66

77
## EDOT Node.js

docs/_edot-sdks/python/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: EDOT Python
33
layout: default
4-
nav_order: 5
4+
nav_order: 6
55
---
66

77
## EDOT Python

docs/_sass/custom/custom.scss

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/* ---- Features Table ------ */
2+
3+
table.features-table {
4+
min-width: unset !important;
5+
max-width: 43rem;
6+
}
7+
8+
9+
table.features-table th {
10+
min-width: unset !important;
11+
}
12+
13+
table.features-table td.s {
14+
min-width: 35px;
15+
}
16+
17+
table.features-table th.r {
18+
height: 60px;
19+
white-space: nowrap;
20+
border-left: none;
21+
}
22+
23+
table.features-table th.r > div {
24+
transform:
25+
translate(7px, -2px)
26+
rotate(315deg);
27+
28+
border-bottom: 1px solid #ccc;
29+
min-width: 70px;
30+
text-align: start;
31+
}
32+
33+
table.features-table th.f {
34+
vertical-align: bottom;
35+
text-align: left;
36+
}
37+
38+
table.features-table td.f {
39+
width: 100%;
40+
}
41+
42+
table.features-table th.l {
43+
width: 100%;
44+
border: unset;
45+
}
46+
47+
table.features-table .s {
48+
max-width: 35px;
49+
}
50+
51+
table.features-table td.s {
52+
padding: unset !important;
53+
text-align: center;
54+
}
55+
56+
table.features-table td.b {
57+
border-right: 1px solid #eeebee;
58+
min-width: 38px !important;
59+
max-width: 38px;
60+
}
61+
62+
table.features-table th.l > div {
63+
display: flex;
64+
justify-content: space-between; /* Distributes items evenly */
65+
width: 100%;
66+
flex-direction: row;
67+
}
68+
69+
table.features-table th.l > div > div {
70+
flex: 1; /* Allows items to grow equally */
71+
text-align: center; /* Centers text within each item */
72+
padding: 5px; /* Adjust padding as needed */
73+
}
74+
75+
/* ------------------------ */
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Jinja2==3.1.6
2+
PyYAML==6.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{%- macro icon(value) -%}
2+
{%- if value == "supported" -%}
3+
4+
{%- elif value == "not-supported" -%}
5+
6+
{%- elif value == "not-applicable" -%}
7+
8+
{%- elif value == "tech-preview" -%}
9+
𝐓
10+
{%- else %}
11+
{%- endif -%}
12+
{%- endmacro %}
13+
{% macro title(feature) -%}
14+
{%- if 'link' in feature and feature['link'] -%}
15+
<a href="{{ feature['link'] }}">{{ feature['name'] }}</a>
16+
{%- else -%}
17+
{{ feature['name'] }}
18+
{%- endif -%}
19+
{%- endmacro -%}
20+
<table class="features-table">
21+
<thead>
22+
<tr>
23+
<th class="l" colspan="8">
24+
<div>
25+
<div>✅ supported</div>
26+
<div>𝐓 in technical preview</div>
27+
<div>➖ not applicable</div>
28+
<div>❌ not supported</div>
29+
</div>
30+
</th>
31+
</tr>
32+
<tr>
33+
<th class="f"><div>Feature</div></th>
34+
<th class="r s"><div>.NET </div></th>
35+
<th class="r s"><div>Java</div></th>
36+
<th class="r s"><div>Node.js</div></th>
37+
<th class="r s"><div>PHP</div></th>
38+
<th class="r s"><div>Python</div></th>
39+
<th class="r s"><div>Android</div></th>
40+
<th class="r s"><div>iOS</div></th>
41+
</tr>
42+
</thead>
43+
<tbody>
44+
{%- for feature in features %}
45+
<!-- Feature: {{ feature['name'] }} -->
46+
<tr>
47+
<td class="f">{{ title(feature) }}</td>
48+
<td class="s">{{ icon(feature['dotnet']) }}</td> <!-- .NET -->
49+
<td class="s">{{ icon(feature['java']) }}</td> <!-- Java -->
50+
<td class="s">{{ icon(feature['nodejs']) }}</td> <!-- Node.js -->
51+
<td class="s">{{ icon(feature['php']) }}</td> <!-- PHP -->
52+
<td class="s">{{ icon(feature['python']) }}</td> <!-- Python -->
53+
<td class="s">{{ icon(feature['android']) }}</td> <!-- Android -->
54+
<td class="s b">{{ icon(feature['ios']) }}</td> <!-- iOS -->
55+
</tr>
56+
{%- endfor %}
57+
</tbody>
58+
</table>

docs/gen_edot_col_components/tools.py

+34-19
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
from jinja2 import Environment, FileSystemLoader
22
import urllib.request
33
from collections import defaultdict
4-
import re
5-
6-
import os
4+
import yaml
75
import re
86
from pathlib import Path
97

108
TABLE_TAG = 'edot-collector-components-table'
119
DEPS_TAG = 'edot-collector-components-ocb'
10+
FEATURES_TAG = 'edot-features'
1211

1312
def fetch_url_content(url):
1413
try:
@@ -113,24 +112,19 @@ def find_files_with_substring(directory, substring):
113112
print(f"Skipping {file_path}: {e}")
114113
return matching_files
115114

116-
def render_markdown(components, otel_col_version, template):
115+
def render_markdown(data, template):
117116
# Set up the Jinja2 environment
118117
env = Environment(loader=FileSystemLoader('.'))
119118

120119
# Load the template
121120
template = env.get_template(template)
122121

123122
# Define the data to pass to the template
124-
data = {
125-
'grouped_components': components,
126-
'otel_col_version': otel_col_version
127-
}
128123

129124
return template.render(data)
130125

131-
def render_components_into_file(dir, components, otel_col_version, template, tag):
132-
133-
output = render_markdown(components, otel_col_version, template)
126+
def render_components_into_file(dir, data, template, tag):
127+
output = render_markdown(data, template)
134128
start_tag = f'<!-- start:{tag} -->'
135129
end_tag = f'<!-- end:{tag} -->'
136130

@@ -147,8 +141,8 @@ def render_components_into_file(dir, components, otel_col_version, template, tag
147141
with open(filePath, 'w', encoding='utf-8') as file:
148142
file.write(updated_content)
149143

150-
def check_markdown_generation(dir, components, otel_col_version, template, tag):
151-
output = render_markdown(components, otel_col_version, template)
144+
def check_markdown_generation(dir, data, template, tag):
145+
output = render_markdown(data, template)
152146
start_tag = f'<!-- start:{tag} -->'
153147
end_tag = f'<!-- end:{tag} -->'
154148

@@ -164,25 +158,46 @@ def check_markdown_generation(dir, components, otel_col_version, template, tag):
164158

165159
for match in matches:
166160
if match.strip() != output.strip():
167-
print(f'Warning: Generated markdown for collector components is outdated in file {filePath}! Regenerate markdown by running `make generate-collector-components`!')
161+
print(f'Warning: Generated markdown is outdated in file {filePath}! Regenerate markdown by running `make generate-collector-components`!')
168162
return False;
169163

170164
return True;
171165

166+
def get_features_data(source_file):
167+
with open(source_file, 'r') as file:
168+
try:
169+
return yaml.safe_load(file)
170+
except yaml.YAMLError as exc:
171+
print(f"Error reading YAML file: {exc}")
172+
exit(1)
173+
172174
def check_markdown():
173175
col_version = get_collector_version('../_config.yml')
174176
url = f'https://raw.githubusercontent.com/elastic/elastic-agent/refs/tags/v{col_version}/go.mod'
175177
components = get_otel_components(url)
176178
otel_col_version = get_otel_col_upstream_version(url)
177-
tables = check_markdown_generation('../_edot-collector', components, otel_col_version, 'templates/components-table.jinja2', TABLE_TAG)
179+
data = {
180+
'grouped_components': components,
181+
'otel_col_version': otel_col_version
182+
}
183+
tables = check_markdown_generation('../_edot-collector', data, 'templates/components-table.jinja2', TABLE_TAG)
184+
ocb = check_markdown_generation('../_edot-collector', data, 'templates/ocb.jinja2', DEPS_TAG)
178185

179-
ocb = check_markdown_generation('../_edot-collector', components, otel_col_version, 'templates/ocb.jinja2', DEPS_TAG)
180-
return tables and ocb
186+
features_data = get_features_data('../use-cases/features.yml')
187+
features = check_markdown_generation('../use-cases', features_data, 'templates/features.jinja2', FEATURES_TAG)
188+
return tables and ocb and features
181189

182190
def generate_markdown():
183191
col_version = get_collector_version('../_config.yml')
184192
url = f'https://raw.githubusercontent.com/elastic/elastic-agent/refs/tags/v{col_version}/go.mod'
185193
components = get_otel_components(url)
186194
otel_col_version = get_otel_col_upstream_version(url)
187-
render_components_into_file('../_edot-collector', components, otel_col_version, 'templates/components-table.jinja2', TABLE_TAG)
188-
render_components_into_file('../_edot-collector', components, otel_col_version, 'templates/ocb.jinja2', DEPS_TAG)
195+
data = {
196+
'grouped_components': components,
197+
'otel_col_version': otel_col_version
198+
}
199+
render_components_into_file('../_edot-collector', data, 'templates/components-table.jinja2', TABLE_TAG)
200+
render_components_into_file('../_edot-collector', data, 'templates/ocb.jinja2', DEPS_TAG)
201+
202+
features_data = get_features_data('../use-cases/features.yml')
203+
render_components_into_file('../use-cases', features_data, 'templates/features.jinja2', FEATURES_TAG)

docs/quickstart/ech/hosts_vms.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The quick start for Hosts / VMs with with Elastic Cloud Hosted will guide you th
1717

1818
1. **Download the EDOT Collector**
1919

20-
[Download the EDOT Collector](../../edot-collector/download) for your operating system.
20+
[Download the EDOT Collector](../../edot-collector/download) for your operating system, extract the archive and move to the extracted directory.
2121

2222
2. **Configure the EDOT Collector**
2323

@@ -38,7 +38,7 @@ The quick start for Hosts / VMs with with Elastic Cloud Hosted will guide you th
3838
```bash
3939
ELASTICSEARCH_ENDPOINT=<ELASTICSEARCH_ENDPOINT> \
4040
ELASTIC_API_KEY=<ELASTIC_API_KEY> \
41-
rm ./otel.yml && cp ./otel_samples/logs_metrics_traces.yml ./otel.yml && mkdir -p ./data/otelcol && sed -i '' 's#\${env:STORAGE_DIR}#'"$PWD"/data/otelcol'#g' ./otel.yml && sed -i '' 's#\${env:ELASTIC_ENDPOINT}#$ELASTICSEARCH_ENDPOINT' ./otel.yml && sed -i '' 's/\${env:ELASTIC_API_KEY}/$ELASTIC_API_KEY/g' ./otel.yml
41+
rm ./otel.yml && cp ./otel_samples/logs_metrics_traces.yml ./otel.yml && mkdir -p ./data/otelcol && sed -i '' 's#\${env:STORAGE_DIR}#'"$PWD"/data/otelcol'#g' ./otel.yml && sed -i '' 's#\${env:ELASTIC_ENDPOINT}#'"$ELASTICSEARCH_ENDPOINT"'#g' ./otel.yml && sed -i '' 's#\${env:ELASTIC_API_KEY}#'"$ELASTIC_API_KEY"'#g' ./otel.yml
4242
```
4343

4444
*Windows*

docs/quickstart/self-managed/hosts_vms.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The quick start for Hosts / VMs with a self-managed Elastic Stack will guide you
1717

1818
1. **Download the EDOT Collector**
1919

20-
[Download the EDOT Collector](../../edot-collector/download) for your operating system.
20+
[Download the EDOT Collector](../../edot-collector/download) for your operating system, extract the archive and move to the extracted directory.
2121

2222
2. **Configure the EDOT Collector**
2323

@@ -36,7 +36,7 @@ The quick start for Hosts / VMs with a self-managed Elastic Stack will guide you
3636
```bash
3737
ELASTICSEARCH_ENDPOINT=<ELASTICSEARCH_ENDPOINT> \
3838
ELASTIC_API_KEY=<ELASTIC_API_KEY> \
39-
rm ./otel.yml && cp ./otel_samples/logs_metrics_traces.yml ./otel.yml && mkdir -p ./data/otelcol && sed -i '' 's#\${env:STORAGE_DIR}#'"$PWD"/data/otelcol'#g' ./otel.yml && sed -i '' 's#\${env:ELASTIC_ENDPOINT}#$ELASTICSEARCH_ENDPOINT' ./otel.yml && sed -i '' 's/\${env:ELASTIC_API_KEY}/$ELASTIC_API_KEY/g' ./otel.yml
39+
rm ./otel.yml && cp ./otel_samples/logs_metrics_traces.yml ./otel.yml && mkdir -p ./data/otelcol && sed -i '' 's#\${env:STORAGE_DIR}#'"$PWD"/data/otelcol'#g' ./otel.yml && sed -i '' 's#\${env:ELASTIC_ENDPOINT}#'"$ELASTICSEARCH_ENDPOINT"'#g' ./otel.yml && sed -i '' 's#\${env:ELASTIC_API_KEY}#'"$ELASTIC_API_KEY"'#g' ./otel.yml
4040
```
4141

4242
*Windows*

0 commit comments

Comments
 (0)