Skip to content

Conversation

jimmyjames
Copy link
Contributor

@jimmyjames jimmyjames commented Aug 19, 2025

🚀 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:

  • Understand how to integrate the SDK with their observability stack
  • Test and validate the SDK's telemetry functionality
  • Choose between manual configuration vs. agent-based approaches

💡 How is it being solved?

By adding an example that demonstrates:

  • 🔧 Manual Configuration: Code-based OpenTelemetry SDK setup with full control
  • 🤖 Java Agent: Zero-code automatic instrumentation (no application changes needed)
  • 📊 Comprehensive Metrics: All available SDK metrics with detailed attribute configuration

🛠️ What changes are made?

The example provides:

  • Dual-mode operation supporting both manual and agent-based OpenTelemetry integration
  • Local development support with clear instructions for SDK contributors
  • Environment-based configuration using .env files for easy customization
  • Comprehensive documentation with troubleshooting guides and usage examples

🚀 Example Usage

# Run with manual telemetry configuration
make run
# Run with OpenTelemetry Java agent (zero-code)
make run-with-agent

💡 Note: run-with-agent automatically downloads the OpenTelemetry agent JAR if not present

📦 Dependencies

This example introduces one new third-party dependency for environment variable management:

  • dotenv-java

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

  • New Features
    • Added an OpenTelemetry example for the Java SDK with manual and agent-based instrumentation, runnable via Gradle/Makefile.
    • Included a sample .env file and Gradle wrapper for easy local setup.
  • Documentation
    • Added READMEs for examples and OpenTelemetry with setup, run instructions, and guidance for viewing metrics in Prometheus/Grafana.
  • Chores
    • Added Dependabot updates for Gradle in the OpenTelemetry example directory.
    • Expanded .gitignore to exclude .env files and macOS .DS_Store.

Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds 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

Cohort / File(s) Summary
Repo configuration
'.github/dependabot.yaml', '.gitignore'
Dependabot: new Gradle update block for /examples/opentelemetry (monthly, grouped). Gitignore: add .env and .DS_Store patterns.
Examples documentation
'examples/README.md', 'examples/opentelemetry/README.md'
Adds overview of examples and detailed OpenTelemetry example README describing manual vs agent runs, metrics, setup, and troubleshooting.
OTel example env and tooling
'examples/opentelemetry/.env.example', 'examples/opentelemetry/Makefile'
Adds env template for OpenFGA/OTel vars; Makefile targets for build/run, agent run, and running OpenFGA via Docker.
OTel example build config
'examples/opentelemetry/build.gradle', 'examples/opentelemetry/settings.gradle'
Gradle app setup with main class, dependencies (OpenFGA SDK, OpenTelemetry, dotenv), run and runWithAgent tasks, agent download, Spotless config, project name.
Gradle wrapper (OTel example)
'examples/opentelemetry/gradle/wrapper/gradle-wrapper.properties', 'examples/opentelemetry/gradlew', 'examples/opentelemetry/gradlew.bat'
Adds Gradle 8.6 wrapper properties and launchers for POSIX and Windows.
OTel example source
'examples/opentelemetry/src/main/java/dev/openfga/sdk/example/opentelemetry/OpenTelemetryExample.java'
New example app supporting --mode=manual and --mode=agent, loads env, configures OpenTelemetry (manual mode), builds OpenFGA client with telemetry, and loops through typical SDK operations.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Add OpenTelemetry example project for Java SDK (#117)

Assessment against linked issues: Out-of-scope changes

(None)

Possibly related PRs

Suggested reviewers

  • evansims
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/otel-example

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.19%. Comparing base (c70b4d6) to head (c589608).

❌ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jimmyjames jimmyjames marked this pull request as ready for review August 19, 2025 19:28
@jimmyjames jimmyjames requested review from a team as code owners August 19, 2025 19:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 tracked

Ignoring 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.example
examples/opentelemetry/settings.gradle (1)

3-9: Clarify composite build usage with an explicit substitution fallback

The 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 versions

Add 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 clarity

Minor 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 sentence

Small 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_here
examples/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/Jaeger

And 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 Version

The 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: build

Then 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 ?= latest

If 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 and clean 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 clean

Optional: 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} run

Optional 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 script

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

📥 Commits

Reviewing files that changed from the base of the PR and between c70b4d6 and 11271b0.

⛔ 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 ignored

Ignoring .DS_Store repo-wide is good hygiene.

examples/opentelemetry/settings.gradle (1)

1-1: LGTM: project name is clear and scoped to the example

The rootProject name matches the example’s purpose and avoids collisions.

.github/dependabot.yaml (1)

23-31: LGTM: Dependabot coverage extended to the new Gradle example

Monthly 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 in examples/opentelemetry/build.gradle is set to "0.9.0", which matches the <latest> version in Maven Central’s metadata. No update is needed.

jimmyjames and others added 2 commits August 19, 2025 14:44
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Member

@dyeam0 dyeam0 left a 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!

@jimmyjames jimmyjames added this pull request to the merge queue Aug 27, 2025
Merged via the queue into main with commit 38f94be Aug 27, 2025
25 checks passed
@jimmyjames jimmyjames deleted the docs/otel-example branch August 27, 2025 14:11
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.

docs(OpenTelemetry): add example project
4 participants