Skip to content
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

OTEL traces use "contextID" and "contextId" #246

Open
jlewi opened this issue Sep 18, 2024 · 1 comment
Open

OTEL traces use "contextID" and "contextId" #246

jlewi opened this issue Sep 18, 2024 · 1 comment

Comments

@jlewi
Copy link
Owner

jlewi commented Sep 18, 2024

We are using "contextID" and "contextId" as attributes on the spans. We need to pick a preferred form and stick to it.
We should document it in a style guide.

@jlewi
Copy link
Owner Author

jlewi commented Sep 18, 2024

Claude says "contextId"
https://stackoverflow.com/questions/779929/id-id-or-id

In proto -> GoLang
"context_id" becomes "contextId"

string context_id = 1;

Which also means the JSON serialization is contextId

{
  "insertId": "1vqy98uf1w00ei",
  "jsonPayload": {
    "severity": "info",
    "message": "Anthropic:CreateMessages",
    "function": "github.com/jlewi/foyle/app/pkg/anthropic.(*Completer).Complete",
    "traceId": "dd7e1d3650987812ec3bf8a7accc3a51",
    "streamTraceId": "1c73737a0ab5311452d572072bc72df3",
    "time": 1726632316.254349,
    "evalMode": false,
    "request": {
      ...
     },
    "contextId": "01J81MWH3DVVCW9ZMV564ED325",
    "caller": "anthropic/completer.go:68"
  },
  "resource": {
    "type": "project",
    "labels": {
      "project_id": "foyle-dev"
    }
  },
}

But seems like this contradicts GoStyle and linter
https://www.reddit.com/r/golang/comments/168r2fc/id_or_id/
https://google.github.io/styleguide/go/decisions#initialisms

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

No branches or pull requests

1 participant