Skip to content

Clarify Prometheus scrape config and counter naming in OpenTelemetry diagnostics example - #55447

Closed
adegeo with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-prometheus-configuration
Closed

Clarify Prometheus scrape config and counter naming in OpenTelemetry diagnostics example#55447
adegeo with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-prometheus-configuration

Conversation

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The Prometheus setup guidance could be read as modifying the built-in prometheus scrape job, which leads to invalid YAML/duplicate scrape_interval behavior in real setups. The same section also left ambiguity around how greetings.count appears in Prometheus and how description text is applied.

  • Prometheus config guidance (section 7.1)

    • Reworked the sample YAML to show adding a dedicated app scrape job (OpenTelemetryTest) instead of editing the default prometheus job.
    • Added explicit instruction to keep the existing prometheus job unchanged.
  • Metric naming clarification

    • Clarified that the counter description (Counts the number of greetings) is metadata, while Prometheus-normalized metric name is greetings_count.
    • This aligns the narrative with the snippet behavior and the observed metric in Prometheus UI.
  • Doc metadata

    • Added required frontmatter key for AI-authored doc edits: ai-usage: ai-assisted.
scrape_configs:
  - job_name: "OpenTelemetryTest"
    scrape_interval: 1s # poll very quickly for a more responsive demo
    static_configs:
      - targets: ["localhost:5212"]

Copilot AI lite review requested due to automatic review settings August 14, 2026 23:31

Copilot AI 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.

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.

@adegeo
adegeo requested a review from tommcdon August 14, 2026 23:32
Copilot AI linked an issue Aug 14, 2026 that may be closed by this pull request
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
Copilot AI requested a review from adegeo August 14, 2026 23:34
```

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@adegeo adegeo closed this Aug 20, 2026
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.

Prometheus Configuration

4 participants