{"id":14971694,"url":"https://github.com/grafana/otel-checker","last_synced_at":"2025-07-01T08:33:56.960Z","repository":{"id":254894906,"uuid":"840445068","full_name":"grafana/otel-checker","owner":"grafana","description":"Otel Me If It's Right project","archived":false,"fork":false,"pushed_at":"2025-06-24T00:49:33.000Z","size":6640,"stargazers_count":14,"open_issues_count":16,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-24T01:34:32.078Z","etag":null,"topics":["keep","opentelemetry"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-09T18:11:21.000Z","updated_at":"2025-06-24T00:55:01.000Z","dependencies_parsed_at":"2025-03-31T11:23:31.459Z","dependency_job_id":"0550157f-c87e-4694-9db9-d1515c389af1","html_url":"https://github.com/grafana/otel-checker","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"eea290600b53096bef619287520f6138fe2d83e6"},"previous_names":["grafana/otel-checker"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/grafana/otel-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/otel-checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-checker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262928158,"owners_count":23386089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keep","opentelemetry"],"created_at":"2024-09-24T13:45:40.522Z","updated_at":"2025-07-01T08:33:56.948Z","avatar_url":"https://github.com/grafana.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OTel Me If It's Right\n\nChecker for if the implementation of OpenTelemetry instrumentation is correct by scanning the code in your repository, checking environment variables, validating your Grafana token and more.\n\n## Usage\n\nRequirement: Golang\n\n## Installation\n\n1. Install the `otel-checker` binary\n\n   ```text\n   go install github.com/grafana/otel-checker@latest\n   ```\n\n2. You can confirm it was installed with:\n\n   ```terminal\n   ❯ ls $GOPATH/bin\n   otel-checker\n   ```\n\n## Flags\n\nThe available flags are shown below:\n\n\u003c!-- markdownlint-disable MD010 --\u003e\n\n```terminal\n❯ otel-checker -h\nUsage of otel-checker:\n  -manual-instrumentation\n    \tProvide if your application is using manual instrumentation (auto instrumentation as default)\n  -collector-config-path string\n    \tPath to collector's config.yaml file. Required if using Collector and the config file is not in the same location as the otel-checker is being executed from. E.g. \"-collector-config-path=src/inst/\"\n  -components string\n    \tInstrumentation components to test, separated by ',' (required). Possible values: sdk, collector, beyla, alloy, grafana-cloud\n  -debug\n        Output debug information\n  -instrumentation-file string\n    \tName (including path) to instrumentation file. Required if using manual-instrumentation. E.g.\"-instrumentation-file=src/inst/instrumentation.js\"\n  -language string\n    \tLanguage used for instrumentation (required). Possible values: dotnet, go, java, js, python, ruby, php\n  -package-json-path string\n    \tPath to package.json file. Required if instrumentation is in JavaScript and the file is not in the same location as the otel-checker is being executed from. E.g. \"-package-json-path=src/inst/\"\n  -web-server\n        Set if you would like the results served in a web server in addition to console output\n```\n\n\u003c!-- markdownlint-enable MD010 --\u003e\n\n## Checks\n\n### Common Environment Variables\n\nThese checks are automatically performed for all languages and components.\n\n- Best practices for setting common environment variables:\n  - Service name\n  - Exporter protocol\n\n- Resource attributes checks:\n  - Validates the presence of recommended OpenTelemetry resource attributes\n  - Checks for the following attributes:\n    - `service.name` (via `OTEL_SERVICE_NAME` or in `OTEL_RESOURCE_ATTRIBUTES`)\n    - `service.namespace` (e.g., `shop`)\n    - `deployment.environment.name` (e.g., `production`)\n    - `service.instance.id` (e.g., `checkout-123`)\n    - `service.version` (e.g., `1.2`)\n  - For missing attributes, provides specific recommendations with example values\n  - Follows the [OpenTelemetry specification](https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/) for precedence (e.g., `OTEL_SERVICE_NAME` takes precedence over `service.name` in `OTEL_RESOURCE_ATTRIBUTES`)\n  - Example warning: `Set OTEL_RESOURCE_ATTRIBUTES=\"service.namespace=shop\": An optional namespace for service.name`\n\n### Grafana Cloud\n\nUse the `-components=grafana-cloud` flag to check the following:\n\n- Endpoints\n- Authentication\n\n### SDK\n\n#### JavaScript\n\nUse `-components=sdk -language=js` flag to check the following:\n\n- Node version\n- Required dependencies on package.json\n- Required environment variables\n- Resource detectors\n- Dependencies compatible with Grafana Cloud\n- Usage of Console Exporter\n- Prints which libraries are supported based on the `package.json` in the current directory.\n\n#### Python\n\nUse `-components=sdk -language=python` flag to check the following:\n\n- Prints which libraries are supported:\n  - The used libraries are discovered from `requirements.txt` in the current directory.\n\n#### .NET\n\nUse `-components=sdk -language=dotnet` flag to check the following:\n\n- .NET version\n- Available instrumentation for .NET libraries and dependencies\n- Auto-instrumentation environment variables\n\n\u003e [!NOTE]\n\u003e Only .NET 8.0 and higher are supported\n\n#### Java\n\nUse `-components=sdk -language=java` flag to check the following:\n\n- Java version\n- Prints which libraries (as discovered from a locally running maven or gradle) are supported:\n  - With `-manual-instrumentation`, the libraries for manual instrumentation are printed.\n  - Without `-manual-instrumentation`, it will print the libraries supported by the [Java Agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation/).\n  - A maven or gradle wrapper will be used if found in the current directory or a parent directory.\n\n#### Go\n\nUse `-components=sdk -language=go` flag to check the following:\n\n- Prints which libraries are supported for manual instrumentation\n  based on the `go.mod` in the current directory.\n\n#### Ruby\n\nUse `-components=sdk -language=ruby` flag to check the following:\n\n- Ruby version\n- Bundler installation\n- `Gemfile` and `Gemfile.lock` exist\n- Required dependencies installed\n- Optional auto-instrumentation dependencies installed\n\n#### PHP\n\nUse `-components=sdk -language=php` flag to check the following:\n\n- PHP version\n- Composer installation\n- `composer.json` and `composer.lock` exist\n- Required dependencies in `composer.lock`\n- Some auto-instrumentation dependencies installed\n\n### Collector\n\nUse `-components=collector` flag to check the following:\n\n- Config receivers and exporters\n\n### Beyla\n\nUse `-components=beyla` flag to check the following:\n\n- Environment variables\n\n### Alloy\n\n\u003e [!NOTE]\n\u003e TBD\n\n## Examples\n\nApplication with auto-instrumentation\n![auto instrumentation exemple](./assets/auto.png)\n\nApplication with custom instrumentation using SDKs and Collector\n![sdk and collector example](./assets/sdk.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fotel-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fotel-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fotel-checker/lists"}