Skip to content

Bug 2034765: Expose glean telemetry dictionary in a standardized format#783

Open
michaelvanstraten wants to merge 6 commits into
mozilla:enterprise-mainfrom
tbr11:feat/glean-semconv-task
Open

Bug 2034765: Expose glean telemetry dictionary in a standardized format#783
michaelvanstraten wants to merge 6 commits into
mozilla:enterprise-mainfrom
tbr11:feat/glean-semconv-task

Conversation

@michaelvanstraten

@michaelvanstraten michaelvanstraten commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Description

Bugzilla: Bug-2034765

To support client side telemetry reporting to generic Open Telemetry compatible endpoint we need to convert the glean telemetry dictionary information into a schema that is standardized and well understood.

This patch sets up a task that generates a semconv schema from all metrics.yaml files and uploads it as an artifact.

You can run the generator manually by running:

mach glean semconv

@michaelvanstraten
michaelvanstraten force-pushed the feat/glean-semconv-task branch from 210a65d to 452eb95 Compare April 24, 2026 10:52
@michaelvanstraten michaelvanstraten changed the title WIP: Feat/glean semconv task Expose glean telemetry dictionary in a standardized format Apr 24, 2026
@michaelvanstraten
michaelvanstraten marked this pull request as ready for review April 24, 2026 10:57
@michaelvanstraten michaelvanstraten changed the title Expose glean telemetry dictionary in a standardized format Bug 2034765: Expose glean telemetry dictionary in a standardized format Apr 24, 2026
@michaelvanstraten
michaelvanstraten requested review from jonathanmendez and lissyx and removed request for lissyx April 24, 2026 12:43
@michaelvanstraten

michaelvanstraten commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Hi @jonathanmendez, I heard that you started to get familiar with task cluster, this might be the perfect PR to review for you :)?

@jonathanmendez jonathanmendez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had time to review all of the python, but I have some comments on the rest so far.

I don't feel like I am enough to review this on my own. I would add @ahal for extra taskcluster coverage at least.

with open(manifest_path, "w") as f:
yaml.dump(manifest, f, sort_keys=False, allow_unicode=True)

manifest_errors = validate_against_schema(manifest, MANIFEST_SCHEMA_PATH)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think this validation should happen before writing the file(s).

I would expect either:

if validate_resolved():
  print errors
  exit
write_resolved()
print("Wrote resolved")

if validate_manifest():
  print errors
  exit
write_manifest()
print("Wrote manifest")

or:

if validate_resolved():
  print errors
  exit
if validate_manifest():
  print errors
  exit

write_resolved()
write_manifest()

print("Wrote resolved")
print("Wrote manifest")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a very good point, thank you.

mach: "glean semconv --output-dir /builds/worker/artifacts"
use-caches: [checkout, pip, uv]
attributes:
shippable: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this marked shippable?

index:
product: firefox
job-name: glean-semconv
type: shippable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above: why is this marked shippable?

Comment on lines +983 to +986
Tasks that run ``./mach glean`` utilities. The ``semconv`` task produces the
resolved OTel semantic convention registry schema from Firefox Glean metric
definitions, consumed by the ``moa generate release``
tool.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to provide better context for what any of this means? I barely know what OTel means (using "OpenTelemetry" would be nicer), but would have no idea what a "resolved semantic convention registry schema" is nor what the moa generate release tool is or why we want to use the moa generate release tool.

Here's an attempt:

Suggested change
Tasks that run ``./mach glean`` utilities. The ``semconv`` task produces the
resolved OTel semantic convention registry schema from Firefox Glean metric
definitions, consumed by the ``moa generate release``
tool.
Tasks that run ``./mach glean`` utilities.
The ``semconv`` task transforms Firefox Glean metric definitions into
a standardized OpenTelemetry format known as "Semantic Conventions".
This format can be consumed by the [[tooling explained by purpose]].

tasks:
semconv:
description: >-
Generate the resolved OTel semantic convention registry schema from

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concerns on the description as above in kinds.rst

@@ -0,0 +1,124 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a process for vendoring components: https://firefox-source-docs.mozilla.org/mozbuild/vendor/index.html

I don't know if it works differently when there's only a couple of schema files, but it does feel odd for them to just be here in the source without any indication that they are third party.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, valid point. I will add a moz.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants