-
Notifications
You must be signed in to change notification settings - Fork 378
Expand file tree
/
Copy pathOpenTelemetryConstants.cs
More file actions
41 lines (29 loc) · 1.84 KB
/
OpenTelemetryConstants.cs
File metadata and controls
41 lines (29 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace OpenAI.Telemetry;
internal class OpenTelemetryConstants
{
// OpenTelemetry GenAI semantic conventions.
// Default (v1.27.0): https://github.com/open-telemetry/semantic-conventions/tree/v1.27.0/docs/gen-ai
// Set OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental to use the latest conventions
// (https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai).
public const string ErrorTypeKey = "error.type";
public const string ServerAddressKey = "server.address";
public const string ServerPortKey = "server.port";
public const string GenAiClientOperationDurationMetricName = "gen_ai.client.operation.duration";
public const string GenAiClientTokenUsageMetricName = "gen_ai.client.token.usage";
public const string GenAiOperationNameKey = "gen_ai.operation.name";
public const string GenAiRequestMaxTokensKey = "gen_ai.request.max_tokens";
public const string GenAiRequestModelKey = "gen_ai.request.model";
public const string GenAiRequestTemperatureKey = "gen_ai.request.temperature";
public const string GenAiRequestTopPKey = "gen_ai.request.top_p";
public const string GenAiResponseIdKey = "gen_ai.response.id";
public const string GenAiResponseFinishReasonKey = "gen_ai.response.finish_reasons";
public const string GenAiResponseModelKey = "gen_ai.response.model";
// v1.27.0: gen_ai.system
public const string GenAiSystemKey = "gen_ai.system";
public const string GenAiSystemValue = "openai";
// Latest (replaces gen_ai.system): gen_ai.provider.name
public const string GenAiProviderNameKey = "gen_ai.provider.name";
public const string GenAiTokenTypeKey = "gen_ai.token.type";
public const string GenAiUsageInputTokensKey = "gen_ai.usage.input_tokens";
public const string GenAiUsageOutputTokensKey = "gen_ai.usage.output_tokens";
}