{"id":15137145,"url":"https://github.com/alexcheng1982/java-ai-app-observation","last_synced_at":"2026-02-01T06:32:21.038Z","repository":{"id":230150366,"uuid":"778570241","full_name":"alexcheng1982/java-ai-app-observation","owner":"alexcheng1982","description":"Java AI App Observability","archived":false,"fork":false,"pushed_at":"2024-04-03T14:31:52.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-21T21:45:49.441Z","etag":null,"topics":["ai","java","opentelemetry","spring","spring-ai"],"latest_commit_sha":null,"homepage":"","language":"Java","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/alexcheng1982.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-03-28T00:59:57.000Z","updated_at":"2024-03-28T05:14:51.000Z","dependencies_parsed_at":"2024-03-28T05:30:49.488Z","dependency_job_id":"afbd3abc-c900-4e79-8598-e675752e37d6","html_url":"https://github.com/alexcheng1982/java-ai-app-observation","commit_stats":null,"previous_names":["alexcheng1982/ai-observation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexcheng1982/java-ai-app-observation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fjava-ai-app-observation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fjava-ai-app-observation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fjava-ai-app-observation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fjava-ai-app-observation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexcheng1982","download_url":"https://codeload.github.com/alexcheng1982/java-ai-app-observation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fjava-ai-app-observation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28970539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T05:48:53.985Z","status":"ssl_error","status_checked_at":"2026-02-01T05:47:55.855Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai","java","opentelemetry","spring","spring-ai"],"created_at":"2024-09-26T07:00:22.868Z","updated_at":"2026-02-01T06:32:21.019Z","avatar_url":"https://github.com/alexcheng1982.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java AI App Observation\n\n## Spring AI\n\n### OpenTelemetry\n\nSee the example app in [examples/spring-ai-example](examples/spring-ai-example).\n\n#### Metrics\n\n| Name                                  | Type      | Description                           |\n|---------------------------------------|-----------|---------------------------------------|\n| `chat.client.call.duration`           | Histogram | Duration of ChatClient call requests  |\n| `chat.client.prompt.tokens.count`     | Counter   | Count of ChatClient prompt tokens     |\n| `chat.client.generation.tokens.count` | Counter   | Count of ChatClient generation tokens |\n| `chat.client.total.tokens.count`      | Counter   | Count of ChatClient total tokens      |\n\nFor `ChatClient`s, using `ChatClientTelemetry` to wrap an existing `ChatClient`.\n\n```java\n\n@Configuration\npublic class ApplicationConfiguration {\n\n  @Bean\n  @Primary\n  public ChatClient chatClient(OllamaChatClient ollamaChatClient,\n      OpenTelemetry openTelemetry) {\n    return ChatClientTelemetry.builder(openTelemetry)\n        .tracePromptContent(true) // Trace prompt content\n        .traceChatResponseContent(true) // Trace chat response content\n        .build()\n        .newChatClient(ollamaChatClient);\n  }\n\n  @Bean\n  public OpenTelemetry openTelemetry(ApplicationContext applicationContext) {\n    return AutoConfiguredOpenTelemetrySdk.builder()\n        .addResourceCustomizer(\n            ((resource, configProperties) -\u003e resource.toBuilder()\n                .put(AttributeKey.stringKey(\"service.name\"),\n                    Optional.ofNullable(applicationContext.getId())\n                        .orElseGet(applicationContext::getDisplayName))\n                .build()))\n        .setResultAsGlobal()\n        .build()\n        .getOpenTelemetrySdk();\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcheng1982%2Fjava-ai-app-observation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexcheng1982%2Fjava-ai-app-observation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcheng1982%2Fjava-ai-app-observation/lists"}