Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,10 @@ build/pgo/blueprint/**/*.css
# Ignore web-platform tests as they are not necessarily under our control.
testing/web-platform/tests/

# These are vendored from https://github.com/open-telemetry/weaver/blob/173fed70c05bf9c7833f59f80aae09642ac05114/schemas/
toolkit/components/glean/build_scripts/semconv/schemas/publication-manifest.v2.json
toolkit/components/glean/build_scripts/semconv/schemas/semconv.resolved.v2.json

##############################################################################
# The list below is copied from ThirdPartyPaths.txt. Prettier doesn't currently
# support multiple ignore files or dynamic ignore configurations.
Expand Down
1 change: 1 addition & 0 deletions taskcluster/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ treeherder:
'updt-tst': 'Test updates to release from older firefox versions'
'Rpk-Ent': 'Enterprise repacks'
'Rpk-Ent-Rpk': 'Enterprise repacks repackage'
'Glean': 'Glean tooling'
'Rpk': 'Classic repacks'
'MSI-Ent': "MSI Enterprise repacks"
'MSIs-Ent': "MSI signed Enterprise repacks"
Expand Down
7 changes: 7 additions & 0 deletions taskcluster/docs/kinds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -977,3 +977,10 @@ Mac notarization of customized versions of releases for enterprises.
enterprise-repack-mac-signing
----------------------------------
Mac signature of customized versions of releases for enterprises.

glean
-----
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.
Comment on lines +983 to +986

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]].

48 changes: 48 additions & 0 deletions taskcluster/kinds/glean/kind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
loader: taskgraph.loader.transform:loader

transforms:
- gecko_taskgraph.transforms.job:transforms
- gecko_taskgraph.transforms.task:transforms

kind-dependencies:
- toolchain
- fetch

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

Firefox Glean metric definitions. The resulting resolved.yaml is
consumed by the `moa generate release` tool, which embeds it as a
semconv referrer artifact on Harbor.
run-on-projects: ["enterprise-firefox"]
run-on-repo-type: ["git"]
worker-type: b-linux
worker:
docker-image: {in-tree: "lint"}
max-run-time: 1800
artifacts:
- type: file
name: public/build/resolved.yaml
path: /builds/worker/artifacts/resolved.yaml
- type: file
name: public/build/manifest.yaml
path: /builds/worker/artifacts/manifest.yaml
run:
using: mach
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?

shipping-phase: build
shipping-product: firefox-enterprise
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?

treeherder:
symbol: Glean(semconv)
kind: build
platform: linux64/opt
tier: 1
22 changes: 22 additions & 0 deletions toolkit/components/glean/build_scripts/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,28 @@ def glean_source(command_context, cargo_toml, content, patch=None):
)


@SubCommand(
"glean",
"semconv",
description="Convert parsed Glean metrics into a resolved OTel semconv registry schema.",
)
@CommandArgument(
"--output-dir",
type=str,
default=None,
help="Directory to write resolved.yaml and manifest.yaml into.",
)
def glean_semconv(command_context, output_dir=None):
import sys

COMPONENT_DIR = Path(__file__).parent.resolve()
sys.path.insert(0, str(COMPONENT_DIR))

from semconv import run

run(output_dir=Path(output_dir) if output_dir else None)


def run_mach(command_context, cmd, **kwargs):
return command_context._mach_context.commands.dispatch(
cmd, command_context._mach_context, **kwargs
Expand Down
Loading