Skip to content

Conversation

@sandhose
Copy link
Member

This reports the version from a git describe --tags --dirty in:

  • the metrics, as a resource:
    target_info{os_type="macos",process_command_args="[\"mas-cli\"]",process_pid="35291",process_runtime_name="rust",process_runtime_version="1.83.0",service_name="mas-cli",service_version="v0.12.0-383-g168657cb2",telemetry_sdk_language="rust",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="0.27.1"} 1
    
  • by running mas-cli --version:
    $ mas-cli --version
    mas-cli v0.12.0-383-g168657cb2
    
  • on startup in the logs:
    2024-12-12T16:37:00.317253Z  INFO cli.run.init: mas_cli::commands::server: crates/cli/src/commands/server.rs:63: Starting up version="v0.12.0-383-g168657cb2"
    

This adds a dependency on the git CLI at build time, which is probably fine. The alternative would be to use the gix crate which is pure-Rust, but this is probably overkill and would add many crates in the dependency tree.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 12, 2024

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 168657c
Status: ✅  Deploy successful!
Preview URL: https://87e872cc.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-build-time-version.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose merged commit f2221d3 into main Dec 12, 2024
19 checks passed
@sandhose sandhose deleted the quenting/build-time-version branch December 12, 2024 16:59
@sandhose sandhose added A-CI Related to continuous integration/GitHub Actions T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. A-CLI Related to the command line utility A-Metrics Related to OpenTelemetry/Prometheus metrics T-Enhancement New feature of request and removed A-CI Related to continuous integration/GitHub Actions T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Related to the command line utility A-Metrics Related to OpenTelemetry/Prometheus metrics T-Enhancement New feature of request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants