Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@jimmyjames
Copy link
Contributor

@jimmyjames jimmyjames commented Feb 12, 2025

If no telemetry is explicitly configured, record the default metrics and attributes.

Description

Currently, if telemetry is not explicitly configured by a customer, no attributes are sent with the default metrics.

This change ensures that the documented default attributes are sent along with the metrics if no telemetry configuration was provided. If there is a provided telemetry configuration, we will use that. It also update Metrics to only create a histogram/counter if it is configured in the telemetryConfiguration.

Added unit tests for the above scenarios, as well as verified in the example application that the default attributes are sent if there is no configuration, and that the metrics are not set if not configured.

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 33.07%. Comparing base (de4e783) to head (421b5c5).

❌ Your project status has failed because the head coverage (33.07%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #145      +/-   ##
============================================
+ Coverage     32.86%   33.07%   +0.21%     
- Complexity      974      984      +10     
============================================
  Files           182      182              
  Lines          6880     6896      +16     
  Branches        764      769       +5     
============================================
+ Hits           2261     2281      +20     
+ Misses         4512     4509       -3     
+ Partials        107      106       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jimmyjames jimmyjames marked this pull request as ready for review February 13, 2025 19:06
@jimmyjames jimmyjames requested a review from a team as a code owner February 13, 2025 19:06
@jimmyjames jimmyjames added this pull request to the merge queue Feb 18, 2025
Merged via the queue into main with commit f487f6c Feb 18, 2025
19 checks passed
@jimmyjames jimmyjames deleted the fix/otel-defaults branch February 18, 2025 14:59
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.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.