Skip to content

Commit 252b303

Browse files
committed
chore: add "Open in Dash0" links
1 parent 8df0a05 commit 252b303

File tree

9 files changed

+60
-10
lines changed

9 files changed

+60
-10
lines changed

model/logging/attributes.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ groups:
1717
- ref: dash0.log.ai.attributes_inferred
1818
- ref: dash0.log.ai.message_inferred
1919
- ref: dash0.log.ai.severity_inferred
20+
- ref: dash0.resource.id
21+
- ref: dash0.resource.hash
22+
- ref: dash0.resource.name
23+
- ref: dash0.resource.type

model/metrics/attributes.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ groups:
1313
- ref: otel.metric.overflow
1414
- ref: otel.scope.name
1515
- ref: otel.scope.version
16+
- ref: dash0.resource.id
17+
- ref: dash0.resource.hash
18+
- ref: dash0.resource.name
19+
- ref: dash0.resource.type

model/tracing/attributes.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ groups:
2020
- ref: dash0.span.type
2121
- ref: dash0.operation.name
2222
- ref: dash0.operation.type
23+
- ref: dash0.resource.id
24+
- ref: dash0.resource.hash
25+
- ref: dash0.resource.name
26+
- ref: dash0.resource.type

model/websites/attributes.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ groups:
1010
- ref: otel.event.name
1111
- ref: otel.scope.name
1212
- ref: otel.scope.version
13+
- ref: dash0.resource.id
14+
- ref: dash0.resource.hash
15+
- ref: dash0.resource.name
16+
- ref: dash0.resource.type

templates/registry/markdown/attribute_namespace.md.j2

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@
2121
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
2222
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->
2323

24+
{%- set dash0_explorer_urls = {
25+
"log": "https://app.dash0.com/goto/logs",
26+
"metric": "https://app.dash0.com/goto/metrics/explorer",
27+
"span": "https://app.dash0.com/goto/traces/explorer",
28+
"web_event": "https://app.dash0.com/goto/web-events/explorer"
29+
} %}
30+
2431
# {{ attrs.humanize(attrs.sentence_case(ctx.id)) | acronym }}
32+
{%- if ctx.id in dash0_explorer_urls %}
33+
34+
[Open in Dash0]({{ dash0_explorer_urls[ctx.id] }})
35+
{%- endif %}
2536

2637
{%- if attr_groups | length > 1 %}
2738
{% for group in attr_groups %}
@@ -39,10 +50,10 @@
3950
{%- endif -%}
4051
**Attributes:**
4152

42-
| Key | Stability | Value Type | Description | Example Values |
43-
| --- | --- | --- | --- | --- |
53+
| Key | Stability | Value Type | Description | Example Values | |
54+
| --- | --- | --- | --- | --- | --- |
4455
{%- for attribute in group.attributes | sort(attribute="name") %}{% set attr_anchor = attribute.name | kebab_case %}
45-
| `{{ attrs.name(attribute) }}` | {{ stability.badge(attribute.stability, attribute.deprecated, attribute.brief) | trim }} | {{ attrs.type(attribute) }} | {{ attribute.brief | trim }}{{ notes.add({"note": attribute.note, "name": attrs.name(attribute)}) }} | {{ examples.format(attribute) }}|
56+
| `{{ attrs.name(attribute) }}` | {{ stability.badge(attribute.stability, attribute.deprecated, attribute.brief) | trim }} | {{ attrs.type(attribute) }} | {{ attribute.brief | trim }}{{ notes.add({"note": attribute.note, "name": attrs.name(attribute)}) }} | {{ examples.format(attribute) }}| {% if ctx.id in dash0_explorer_urls %}[Open in Dash0]({{ dash0_explorer_urls[ctx.id] }}?filter=%5B%7B%22key%22%3A%22{{ attribute.name }}%22%2C%22operator%22%3A%22is_set%22%7D%5D){% endif %} |
4657
{%- endfor %}
4758
{{ notes.render() }}
4859
{%- for enum in group.attributes | sort(attribute="name") %}

templates/registry/markdown/event_namespace.md.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# {{ ctx.id | title_case | acronym }}
77
{% for e in ctx.groups | sort(attribute='name') %}
8-
## {{ e.name | title_case | acronym }}
8+
## {{ e.name | title_case | acronym }} [Open in Dash0](https://app.dash0.com/goto/logs?filter=%5B%7B%22key%22%3A%22otel.event.name%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%22{{ e.name }}%22%7D%5D)
99

1010
{{ event.header(e) | trim }}
1111

templates/registry/markdown/index.html.j2

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
/* Main content */
9898
main {
9999
flex: 1;
100-
max-width: 920px;
100+
min-width: 0;
101101
padding: 2.5rem 3.5rem;
102102
overflow-x: auto;
103103
}
@@ -116,6 +116,26 @@
116116
border-bottom: 1px solid var(--border-subtle);
117117
letter-spacing: -0.01em;
118118
}
119+
main a[href*="app.dash0.com/goto"] {
120+
font-size: 0.7rem;
121+
font-weight: 500;
122+
color: var(--accent);
123+
border: 1px solid var(--accent);
124+
border-radius: 999px;
125+
padding: 0.15rem 0.55rem;
126+
white-space: nowrap;
127+
letter-spacing: 0.01em;
128+
opacity: 0.85;
129+
transition: opacity 0.15s, background 0.15s;
130+
}
131+
main h2 a[href*="app.dash0.com/goto"] {
132+
margin-left: 0.5rem;
133+
vertical-align: middle;
134+
}
135+
main a[href*="app.dash0.com/goto"]:hover {
136+
opacity: 1;
137+
background: var(--accent-dim);
138+
}
119139
main h3 {
120140
font-size: 1.05rem;
121141
font-weight: 600;
@@ -266,7 +286,10 @@
266286
// Rewrite .md links to hash links
267287
content.querySelectorAll('a[href]').forEach(a => {
268288
const href = a.getAttribute('href');
269-
if (href && !href.startsWith('http')) {
289+
if (href && href.startsWith('http')) {
290+
a.setAttribute('target', '_blank');
291+
a.setAttribute('rel', 'noopener noreferrer');
292+
} else if (href) {
270293
const match = href.match(/^(.+\.md)(#.*)?$/);
271294
if (match) {
272295
const base = path.substring(0, path.lastIndexOf('/') + 1);

templates/registry/markdown/metric_namespace.md.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# {{ ctx.id | title_case | acronym }}
1313
{% for group in ctx.groups | sort(attribute='metric_name') %}
14-
## `{{ group.metric_name }}`
14+
## `{{ group.metric_name }}` [Open in Dash0](https://app.dash0.com/goto/metrics/explorer?metric_name={{ group.metric_name }})
1515
{%- if group.deprecated %}
1616

1717
> [!WARNING]

templates/registry/markdown/metric_readme.md.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ The metrics registry is the catalog of available Dash0 metrics.
1313
>
1414
> The following registry overview is a work in progress.
1515

16-
| Namespace | Metric | Instrument | Unit | Stability |
17-
| --------- | ------ | ---------- | ---- | --------- |
16+
| Namespace | Metric | Instrument | Unit | Stability | |
17+
| --------- | ------ | ---------- | ---- | --------- | --- |
1818
{%- import 'stability.j2' as stability -%}
1919
{%- import 'metric_macros.j2' as metrics -%}
2020
{%- for bundle in ctx %}
2121
{%- for group in bundle.groups | sort(attribute='metric_name') -%}
2222
{%- set my_file_name = bundle.id | kebab_case ~ ".md#" ~ (group.metric_name | kebab_case) %}
23-
| {{ bundle.id | title_case | acronym if loop.first }} | [{{ group.metric_name }}]({{my_file_name}}) | {{ metrics.instrument(group.instrument) | trim }} | `{{ group.unit }}` | {{ stability.badge(group.stability, group.deprecated) | trim }} |
23+
| {{ bundle.id | title_case | acronym if loop.first }} | [{{ group.metric_name }}]({{my_file_name}}) | {{ metrics.instrument(group.instrument) | trim }} | `{{ group.unit }}` | {{ stability.badge(group.stability, group.deprecated) | trim }} | [Open in Dash0](https://app.dash0.com/goto/metrics/explorer?metric_name={{ group.metric_name }}) |
2424
{%- endfor %}
2525
{%- endfor %}

0 commit comments

Comments
 (0)