-
Notifications
You must be signed in to change notification settings - Fork 18
docs: add OpenTelemetry example #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds a new OpenTelemetry example project under examples/opentelemetry with Gradle build, wrapper, Makefile, environment template, and example Java app demonstrating manual vs agent-based instrumentation. Updates examples docs, introduces wrapper files, and adds a Dependabot entry for the new Gradle example. Minor .gitignore additions. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant App as OpenTelemetryExample
participant OTel as OpenTelemetry SDK/Agent
participant FGA as OpenFGA Client
participant API as OpenFGA Server
participant OTLP as OTLP Exporter/Collector
Dev->>App: Run with args (--mode=manual | --mode=agent)
alt Manual mode
App->>OTel: Programmatic SDK init (Resource, MeterProvider, OTLP)
OTel-->>App: Global OpenTelemetry registered
else Agent mode
App->>OTel: Start with -javaagent (auto-instrument)
OTel-->>App: Agent initialized
end
App->>FGA: Build client (TelemetryConfiguration, credentials)
loop Operations
App->>API: Read model / Write tuples / Check / BatchCheck / ListObjects
API-->>App: Responses
OTel->>OTLP: Metrics export (request/query/credentials)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(None) Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (35.19%) 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 #211 +/- ##
=========================================
Coverage 35.19% 35.19%
Complexity 1071 1071
=========================================
Files 187 187
Lines 7087 7087
Branches 803 803
=========================================
Hits 2494 2494
Misses 4483 4483
Partials 110 110 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (20)
.gitignore (1)
34-36
: Broaden env ignores and explicitly keep .env.example trackedIgnoring only ".env" is fine, but teams often use variants (e.g., .env.local) and direnv. Add a negation rule to ensure .env.example (and any nested copies) stay tracked.
Apply this diff to extend the ignores:
# env files .env +.env.* +.envrc +!**/.env.exampleexamples/opentelemetry/settings.gradle (1)
3-9
: Clarify composite build usage with an explicit substitution fallbackThe guidance is helpful. If group/module coordinates don’t match exactly, Gradle may not auto-substitute. Consider adding an optional snippet showing how to force substitution.
You can append this to settings.gradle when uncommenting includeBuild:
// Optional: ensure the local composite build is used for the SDK coordinates dependencyResolutionManagement { versionCatalogs { // keep as-is if you use catalogs } } configurations.all { resolutionStrategy.dependencySubstitution { // Substitute published SDK with local project when working locally substitute(module("dev.openfga:openfga-sdk")).using(project(":")) } }And in build.gradle for the example, remove the version from the dependency as noted in your comment:
implementation "dev.openfga:openfga-sdk"
examples/opentelemetry/gradle/wrapper/gradle-wrapper.properties (1)
1-7
: Pin Gradle distributions and align wrapper versionsAdd
distributionSha256Sum
to each wrapper to guard against tampering, and consider standardizing on a single Gradle version across the repo.• examples/basic-examples/gradle/wrapper/gradle-wrapper.properties
– distributionUrl: gradle-8.2.1-all.zip
– Add
diff distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionSha256Sum=REPLACE_WITH_SHA256_FOR_8_2_1_ALL
• examples/opentelemetry/gradle/wrapper/gradle-wrapper.properties
– distributionUrl: gradle-8.6-bin.zip
– Add
diff distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionSha256Sum=REPLACE_WITH_SHA256_FOR_8_6_BIN
• gradle/wrapper/gradle-wrapper.properties
– distributionUrl: gradle-8.2.1-all.zip
– Add
diff distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionSha256Sum=REPLACE_WITH_SHA256_FOR_8_2_1_ALL
Optional: bump all wrappers to Gradle 8.6 to avoid toolchain drift.
examples/README.md (2)
8-9
: Tighten phrasing and punctuation for clarityMinor copy edit to improve readability.
Apply this diff:
-A simple example that creates a store, runs a set of calls against it including creating a model, writing tuples and checking for access. This example is implemented in both Java and Kotlin. +A simple example that creates a store and runs a set of calls against it, including creating a model, writing tuples, and checking access. This example is implemented in both Java and Kotlin.
11-11
: Capitalize “Java agent” and streamline the sentenceSmall doc polish.
Apply this diff:
-- `opentelemetry/` - Demonstrates OpenTelemetry integration both via manual code configuration, as well as no-code instrumentation using the OpenTelemetry java agent +- `opentelemetry/` - Demonstrates OpenTelemetry integration via manual code configuration and no-code instrumentation using the OpenTelemetry Java agent.examples/opentelemetry/.env.example (2)
1-4
: Consider reordering environment variables for better readability.The environment variables would be more intuitive if ordered alphabetically or grouped logically. The linter suggests alphabetical ordering which would improve consistency.
Apply this diff to reorder the variables alphabetically within the OpenFGA configuration section:
# OpenFGA Configuration (REQUIRED) FGA_API_URL=api_url_here -FGA_STORE_ID=store_id_here FGA_MODEL_ID=model_id_here +FGA_STORE_ID=store_id_here
7-10
: Consider reordering authentication environment variables.The authentication variables would be more maintainable if ordered alphabetically or by logical grouping.
Apply this diff to reorder the authentication variables:
# Authentication (optional - for authenticated OpenFGA instances) +FGA_API_AUDIENCE=api_audience_here +FGA_API_TOKEN_ISSUER=api_issuer_here FGA_CLIENT_ID=client_id_here FGA_CLIENT_SECRET=client_secret_here -FGA_API_AUDIENCE=api_audience_here -FGA_API_TOKEN_ISSUER=api_issuer_hereexamples/opentelemetry/README.md (5)
60-63
: Consider formatting bare URLs as markdown links.The bare URLs would be more accessible and readable if formatted as proper markdown links.
Apply this diff to format the URLs as markdown links:
This provides: -- **Jaeger** at http://localhost:16686 - Distributed tracing UI -- **Prometheus** at http://localhost:9090 - Metrics collection and querying -- **Grafana** at http://localhost:3001 - Metrics visualization (admin:admin) +- **Jaeger** at [http://localhost:16686](http://localhost:16686) - Distributed tracing UI +- **Prometheus** at [http://localhost:9090](http://localhost:9090) - Metrics collection and querying +- **Grafana** at [http://localhost:3001](http://localhost:3001) - Metrics visualization (admin:admin)
107-110
: Format bare URLs as markdown links for consistency.Additional bare URLs should be formatted as markdown links for better accessibility.
Apply this diff:
-- **Prometheus**: http://localhost:9090/graph +- **Prometheus**: [http://localhost:9090/graph](http://localhost:9090/graph) - Query: `fga_client_request_duration_bucket` - Query: `fga_client_query_duration_bucket` - Query: `fga_client_credentials_request_total`
112-114
: Format Grafana URL as markdown link.Apply this diff:
-- **Grafana**: http://localhost:3001 (admin:admin) +- **Grafana**: [http://localhost:3001](http://localhost:3001) (admin:admin) - Import dashboard from `grafana/` directory - Or create custom dashboards with the FGA metrics
119-121
: Add language specification to fenced code blocks.The architecture diagrams use fenced code blocks without language specification, which affects syntax highlighting.
Apply this diff to add the
text
language identifier:### Manual Configuration Mode -``` +```text Your App → OpenTelemetry SDK → OTLP Exporter → Collector → Prometheus/JaegerAnd similarly for the Java Agent Mode section: ```diff ### Java Agent Mode -``` +```text Your App → OpenTelemetry Agent → OTLP Exporter → Collector → Prometheus/Jaeger
Also applies to: 130-132 --- `163-163`: **Format remaining bare URLs as markdown links.** Apply this diff: ```diff -### Prometheus (http://localhost:9090) +### Prometheus ([http://localhost:9090](http://localhost:9090))
-### Grafana (http://localhost:3001) +### Grafana ([http://localhost:3001](http://localhost:3001))Also applies to: 182-182
examples/opentelemetry/src/main/java/dev/openfga/sdk/example/opentelemetry/OpenTelemetryExample.java (3)
197-197
: Extract the metrics export interval to use the constant.The inline comment mentions "Export metrics every 10 seconds" but uses
METRICS_EXPORT_INTERVAL_SECONDS
constant. The comment is redundant and could become outdated if the constant changes.Apply this diff to remove the redundant comment:
.registerMetricReader(PeriodicMetricReader.builder(metricExporter) - .setInterval(Duration.ofSeconds(METRICS_EXPORT_INTERVAL_SECONDS)) // Export metrics every 10 seconds + .setInterval(Duration.ofSeconds(METRICS_EXPORT_INTERVAL_SECONDS)) .build())
260-261
: Improve error message for missing required configuration.The error message could be more helpful by guiding users to the .env.example file.
Apply this diff to improve the error message:
if (storeId == null || modelId == null) { - throw new IllegalStateException(ENV_FGA_STORE_ID + " and " + ENV_FGA_MODEL_ID + " must be configured in .env file"); + throw new IllegalStateException(ENV_FGA_STORE_ID + " and " + ENV_FGA_MODEL_ID + " must be configured. Copy .env.example to .env and set these values."); }
313-324
: Consider making write operations conditional or idempotent.The example writes test tuples on every iteration of the continuous loop, which could lead to duplicate data accumulation over time. Consider checking if the tuples already exist before writing, or using a flag to write only once.
Would you like me to provide an implementation that checks for existing tuples before writing, or adds a flag to write test data only on the first iteration?
examples/opentelemetry/build.gradle (1)
72-74
: Update OpenTelemetry Java SDK to Latest Stable VersionThe
examples/opentelemetry/build.gradle
is using OpenTelemetry 1.32.0 (and its alpha). As of August 2025, the latest stable OpenTelemetry Java SDK is 1.53.0, which includes numerous bug fixes and performance improvements. To keep examples up-to-date, please update:• examples/opentelemetry/build.gradle
- openTelemetryVersion = "1.53.0"
- openTelemetryAlphaVersion = "1.53.0-alpha"
This aligns the sample with the current official SDK release.
examples/opentelemetry/Makefile (3)
1-2
: Declare PHONY targets and add missing clean/test to satisfy checkmake and avoid name collisions.checkmake flagged: missing phony targets "all", "clean", "test" and "all" not declared PHONY. Declaring PHONY avoids accidental conflicts with files named like targets and improves DX.
Apply this diff to declare PHONY targets:
-all: build +.PHONY: all build run run-with-agent run-openfga clean test +all: buildThen append clean/test targets (see separate diff on Lines 14-16).
3-3
: Make openfga_version overridable; consider pinning for reproducibility.Using "?=" lets callers override via environment or CLI (e.g.,
make run-openfga openfga_version=v0.4.0
). Consider pinning a concrete version by default in docs to ensure reproducible demos.-openfga_version=latest +openfga_version ?= latestIf you want, I can open a follow-up to choose a recommended pinned OpenFGA version matching your example’s docs and local dev story.
14-16
: Name and auto-clean the container; add test/clean targets.
- Add
--rm
so the container is cleaned up on exit, and--name openfga-example
so it’s easy to stop/remove if needed.- Add
test
andclean
targets mapping to Gradle tasks to round out the example and address checkmake’s required phony targets.run-openfga: - docker pull docker.io/openfga/openfga:${openfga_version} && \ - docker run -p 8080:8080 docker.io/openfga/openfga:${openfga_version} run + docker pull docker.io/openfga/openfga:${openfga_version} && \ + docker run --rm --name openfga-example -p 8080:8080 docker.io/openfga/openfga:${openfga_version} run + +test: + ./gradlew test + +clean: + ./gradlew cleanOptional: if your team typically uses Docker 23+, you can collapse the pull/run and always refresh with
--pull=always
:docker run --pull=always --rm --name openfga-example -p 8080:8080 docker.io/openfga/openfga:${openfga_version} runOptional quality-of-life: a detached variant to keep the server running in the background:
run-openfga-detached: @docker rm -f openfga-example >/dev/null 2>&1 || true docker pull docker.io/openfga/openfga:${openfga_version} docker run -d --rm --name openfga-example -p 8080:8080 docker.io/openfga/openfga:${openfga_version} run
I can add the detached target and a short help target if you’d like.
examples/opentelemetry/gradlew (1)
1-250
: Verified: Standard Gradle wrapper scriptAll automated checks passed:
- examples/opentelemetry/gradlew is executable (100755 on disk and in Git)
- LF line endings only
- examples/opentelemetry/gradle/wrapper/gradle-wrapper.jar and gradle-wrapper.properties are present
- distributionUrl is set in gradle-wrapper.properties
Optional: consider adding a distributionSha256Sum entry in gradle-wrapper.properties to enforce checksum verification of the downloaded distribution.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
examples/opentelemetry/gradle/wrapper/gradle-wrapper.jar
is excluded by!**/*.jar
📒 Files selected for processing (12)
.github/dependabot.yaml
(1 hunks).gitignore
(1 hunks)examples/README.md
(1 hunks)examples/opentelemetry/.env.example
(1 hunks)examples/opentelemetry/Makefile
(1 hunks)examples/opentelemetry/README.md
(1 hunks)examples/opentelemetry/build.gradle
(1 hunks)examples/opentelemetry/gradle/wrapper/gradle-wrapper.properties
(1 hunks)examples/opentelemetry/gradlew
(1 hunks)examples/opentelemetry/gradlew.bat
(1 hunks)examples/opentelemetry/settings.gradle
(1 hunks)examples/opentelemetry/src/main/java/dev/openfga/sdk/example/opentelemetry/OpenTelemetryExample.java
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
examples/opentelemetry/src/main/java/dev/openfga/sdk/example/opentelemetry/OpenTelemetryExample.java (10)
src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java (1)
OpenFgaClient
(34-1309)src/main/java/dev/openfga/sdk/api/configuration/ClientConfiguration.java (1)
ClientConfiguration
(20-143)src/main/java/dev/openfga/sdk/api/configuration/ClientCredentials.java (1)
ClientCredentials
(19-79)src/main/java/dev/openfga/sdk/api/configuration/Credentials.java (1)
Credentials
(17-69)src/main/java/dev/openfga/sdk/api/configuration/TelemetryConfiguration.java (1)
TelemetryConfiguration
(15-72)src/main/java/dev/openfga/sdk/telemetry/Attribute.java (1)
Attribute
(18-38)src/main/java/dev/openfga/sdk/telemetry/Attributes.java (1)
Attributes
(31-216)src/main/java/dev/openfga/sdk/telemetry/Counters.java (1)
Counters
(18-27)src/main/java/dev/openfga/sdk/telemetry/Histograms.java (1)
Histograms
(18-34)src/main/java/dev/openfga/sdk/telemetry/Metric.java (1)
Metric
(15-43)
🪛 LanguageTool
examples/opentelemetry/README.md
[grammar] ~5-~5: There might be a mistake here.
Context: ...w run) - Code-based OpenTelemetry setup 2. **Java Agent** (
./gradlew runWithAgent`) ...
(QB_NEW_EN)
[grammar] ~6-~6: There might be a mistake here.
Context: ...va Agent** (./gradlew runWithAgent
) - Zero-code automatic instrumentation Both app...
(QB_NEW_EN)
[grammar] ~10-~10: There might be a mistake here.
Context: ...fga-client.query.duration- Time taken by FGA server to process requests -
fga-c...
(QB_NEW_EN)
[grammar] ~43-~43: There might be a mistake here.
Context: ...` ## Prerequisites - Java 11 or higher - Docker and Docker Compose - OpenFGA serv...
(QB_NEW_EN)
[grammar] ~44-~44: There might be a mistake here.
Context: ...11 or higher - Docker and Docker Compose - OpenFGA server running (or use the provi...
(QB_NEW_EN)
[grammar] ~60-~60: There might be a mistake here.
Context: ...docker-compose up -d ``` This provides: - Jaeger at http://localhost:16686 - Dis...
(QB_NEW_EN)
[grammar] ~61-~61: There might be a mistake here.
Context: ...localhost:16686 - Distributed tracing UI - Prometheus at http://localhost:9090 - ...
(QB_NEW_EN)
[grammar] ~62-~62: There might be a mistake here.
Context: ...t:9090 - Metrics collection and querying - Grafana at http://localhost:3001 - Met...
(QB_NEW_EN)
[grammar] ~80-~80: There might be a mistake here.
Context: ... run) bash ./gradlew run
Pros: - Full control over OpenTelemetry configur...
(QB_NEW_EN)
[grammar] ~81-~81: There might be a mistake here.
Context: ...control over OpenTelemetry configuration - Can customize metrics, exporters, and re...
(QB_NEW_EN)
[grammar] ~82-~82: There might be a mistake here.
Context: ...etrics, exporters, and resources in code - No external dependencies beyond your app...
(QB_NEW_EN)
[grammar] ~85-~85: There might be a mistake here.
Context: ...dencies beyond your application Cons: - Requires OpenTelemetry SDK dependencies ...
(QB_NEW_EN)
[grammar] ~94-~94: There might be a mistake here.
Context: ...bash ./gradlew runWithAgent ``` Pros: - Zero code changes required - completely ...
(QB_NEW_EN)
[grammar] ~99-~99: There might be a mistake here.
Context: ...le by adding/removing the agent Cons: - Less control over configuration - Requir...
(QB_NEW_EN)
[grammar] ~100-~100: There might be a mistake here.
Context: ...ons:** - Less control over configuration - Requires downloading and managing the ag...
(QB_NEW_EN)
[grammar] ~107-~107: There might be a mistake here.
Context: ...rometheus**: http://localhost:9090/graph - Query: `fga_client_request_duration_buck...
(QB_NEW_EN)
[grammar] ~108-~108: There might be a mistake here.
Context: ... http://localhost:9090/graph - Query: fga_client_request_duration_bucket
- Query: `fga_client_query_duration_bucket...
(QB_NEW_EN)
[grammar] ~109-~109: There might be a mistake here.
Context: ...ent_request_duration_bucket - Query:
fga_client_query_duration_bucket - Query:
fga_client_credentials_request_t...
(QB_NEW_EN)
[grammar] ~112-~112: There might be a mistake here.
Context: ...a**: http://localhost:3001 (admin:admin) - Import dashboard from grafana/
directo...
(QB_NEW_EN)
[grammar] ~123-~123: There might be a mistake here.
Context: ...etheus/Jaeger ``` The application code: 1. Configures OpenTelemetry SDK with OTLP e...
(QB_NEW_EN)
[grammar] ~124-~124: There might be a mistake here.
Context: ...res OpenTelemetry SDK with OTLP exporter 2. Creates OpenFGA client with default tele...
(QB_NEW_EN)
[grammar] ~125-~125: There might be a mistake here.
Context: ...GA client with default telemetry enabled 3. Performs FGA operations which generate m...
(QB_NEW_EN)
[grammar] ~126-~126: There might be a mistake here.
Context: ...ms FGA operations which generate metrics 4. Metrics are exported to the OTLP collect...
(QB_NEW_EN)
[grammar] ~134-~134: There might be a mistake here.
Context: ...eus/Jaeger ``` The OpenTelemetry agent: 1. Automatically detects and instruments th...
(QB_NEW_EN)
[grammar] ~142-~142: There might be a mistake here.
Context: ...roubleshooting ### No Metrics Appearing 1. Verify OTLP collector is running on loca...
(QB_NEW_EN)
[grammar] ~147-~147: There might be a mistake here.
Context: ...rformed ### Manual Configuration Issues - Verify all OpenTelemetry dependencies ar...
(QB_NEW_EN)
[grammar] ~151-~151: There might be a mistake here.
Context: ...ng the FGA client ### Java Agent Issues - Verify the agent JAR was downloaded succ...
(QB_NEW_EN)
[grammar] ~156-~156: There might be a mistake here.
Context: ...startup messages) ### Connection Issues - Verify your .env
file has correct FGA_...
(QB_NEW_EN)
[grammar] ~157-~157: There might be a mistake here.
Context: ...ection Issues - Verify your .env
file has correct FGA_STORE_ID and FGA_MODEL_ID -...
(QB_NEW_EN)
examples/README.md
[grammar] ~7-~7: There might be a mistake here.
Context: ... #### Basic Examples (basic-examples/
) A simple example that creates a store, r...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
examples/opentelemetry/README.md
61-61: Bare URL used
(MD034, no-bare-urls)
62-62: Bare URL used
(MD034, no-bare-urls)
63-63: Bare URL used
(MD034, no-bare-urls)
107-107: Bare URL used
(MD034, no-bare-urls)
112-112: Bare URL used
(MD034, no-bare-urls)
119-119: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
130-130: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
163-163: Bare URL used
(MD034, no-bare-urls)
182-182: Bare URL used
(MD034, no-bare-urls)
🪛 checkmake (0.2.2)
examples/opentelemetry/Makefile
[warning] 1-1: Missing required phony target "all"
(minphony)
[warning] 1-1: Missing required phony target "clean"
(minphony)
[warning] 1-1: Missing required phony target "test"
(minphony)
[warning] 1-1: Target "all" should be declared PHONY.
(phonydeclared)
🪛 dotenv-linter (3.3.0)
examples/opentelemetry/.env.example
[warning] 4-4: [UnorderedKey] The FGA_MODEL_ID key should go before the FGA_STORE_ID key
(UnorderedKey)
[warning] 9-9: [UnorderedKey] The FGA_API_AUDIENCE key should go before the FGA_CLIENT_ID key
(UnorderedKey)
[warning] 10-10: [UnorderedKey] The FGA_API_TOKEN_ISSUER key should go before the FGA_CLIENT_ID key
(UnorderedKey)
🔇 Additional comments (5)
.gitignore (1)
37-38
: LGTM: macOS artifacts ignoredIgnoring .DS_Store repo-wide is good hygiene.
examples/opentelemetry/settings.gradle (1)
1-1
: LGTM: project name is clear and scoped to the exampleThe rootProject name matches the example’s purpose and avoids collisions.
.github/dependabot.yaml (1)
23-31
: LGTM: Dependabot coverage extended to the new Gradle exampleMonthly updates for the example directory with grouping are appropriate and consistent with existing entries.
examples/opentelemetry/gradlew.bat (1)
1-93
: LGTM! Standard Gradle wrapper script.This is the official Gradle wrapper batch script for Windows, properly configured with standard error handling, Java detection, and execution logic. No modifications needed.
examples/opentelemetry/build.gradle (1)
72-72
: OpenFGA SDK version is up to date (0.9.0).The
fgaSdkVersion
inexamples/opentelemetry/build.gradle
is set to"0.9.0"
, which matches the<latest>
version in Maven Central’s metadata. No update is needed.
.../opentelemetry/src/main/java/dev/openfga/sdk/example/opentelemetry/OpenTelemetryExample.java
Show resolved
Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome docs, as always, Jim!
🚀 Add OpenTelemetry Integration Example
Adds an example application demonstrating the SDK's OpenTelemetry metrics capabilities with both manual configuration and zero-code agent approaches.
📋 Description
This PR introduces an OpenTelemetry integration example that showcases the SDK's built-in telemetry features through two different implementation strategies.
🎯 What problem is being solved?
Currently, no example application exists that demonstrates how to configure and use the SDK's OpenTelemetry metrics capabilities. This gap makes it difficult for users to:
💡 How is it being solved?
By adding an example that demonstrates:
🛠️ What changes are made?
The example provides:
.env
files for easy customization🚀 Example Usage
# Run with manual telemetry configuration make run
# Run with OpenTelemetry Java agent (zero-code) make run-with-agent
📦 Dependencies
This example introduces one new third-party dependency for environment variable management:
This dependency is isolated to the example only and does not affect the core SDK.
🔗 References
Fixes #117
https://github.com/cdimascio/dotenv-java/blob/master/LICENSE
Summary by CodeRabbit