Closed
Clarify Prometheus scrape config and counter naming in OpenTelemetry diagnostics example#55447
Conversation
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix YAML formatting in Prometheus configuration
Clarify Prometheus scrape config and counter naming in OpenTelemetry diagnostics example
Aug 14, 2026
tommcdon
reviewed
Aug 20, 2026
| ``` | ||
|
|
||
| Modify the Prometheus YAML configuration file to specify the port for your HTTP scraping endpoint and set a lower scraping interval. For example: | ||
| Modify the Prometheus YAML configuration file and add a scrape job for your app endpoint. Keep the existing `prometheus` job unchanged. For example: |
Member
There was a problem hiding this comment.
The current text states that we should keep the existing prometheus job, but the YAML shows a new top-level scrape_configs section without that job. I suggest showing both jobs or showing only the new - job_name entry and explicitly state add it beneath the existing scrape_configs: key.
| ## 2. Add metrics and activity definitions | ||
|
|
||
| The following code defines a new metric (`greetings.count`) for the number of times the API has been called, and a new activity source (`OtPrGrYa.Example`). | ||
| The following code defines a new metric (`greetings.count`) for the number of times the API has been called, and a new activity source (`OtPrGrYa.Example`). The code sets `Counts the number of greetings` as the metric description, and Prometheus exposes this counter as `greetings_count`. |
Member
There was a problem hiding this comment.
should greetings_count be greetings_count_total? For example, does /metrics output the following?
# TYPE greetings_count_total counter
# HELP greetings_count_total Counts the number of greetings
greetings_count_total{...} 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Prometheus setup guidance could be read as modifying the built-in
prometheusscrape job, which leads to invalid YAML/duplicatescrape_intervalbehavior in real setups. The same section also left ambiguity around howgreetings.countappears in Prometheus and how description text is applied.Prometheus config guidance (section 7.1)
OpenTelemetryTest) instead of editing the defaultprometheusjob.prometheusjob unchanged.Metric naming clarification
Counts the number of greetings) is metadata, while Prometheus-normalized metric name isgreetings_count.Doc metadata
ai-usage: ai-assisted.