openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
src/Utility/Telemetry/OpenTelemetryConstants.cs
33lines · modecode
| 1 | namespace OpenAI.Telemetry; |
| 2 | |
| 3 | internal class OpenTelemetryConstants |
| 4 | { |
| 5 | // follow OpenTelemetry GenAI semantic conventions: |
| 6 | // https://github.com/open-telemetry/semantic-conventions/tree/v1.27.0/docs/gen-ai |
| 7 | |
| 8 | public const string ErrorTypeKey = "error.type"; |
| 9 | public const string ServerAddressKey = "server.address"; |
| 10 | public const string ServerPortKey = "server.port"; |
| 11 | |
| 12 | public const string GenAiClientOperationDurationMetricName = "gen_ai.client.operation.duration"; |
| 13 | public const string GenAiClientTokenUsageMetricName = "gen_ai.client.token.usage"; |
| 14 | |
| 15 | public const string GenAiOperationNameKey = "gen_ai.operation.name"; |
| 16 | |
| 17 | public const string GenAiRequestMaxTokensKey = "gen_ai.request.max_tokens"; |
| 18 | public const string GenAiRequestModelKey = "gen_ai.request.model"; |
| 19 | public const string GenAiRequestTemperatureKey = "gen_ai.request.temperature"; |
| 20 | public const string GenAiRequestTopPKey = "gen_ai.request.top_p"; |
| 21 | |
| 22 | public const string GenAiResponseIdKey = "gen_ai.response.id"; |
| 23 | public const string GenAiResponseFinishReasonKey = "gen_ai.response.finish_reasons"; |
| 24 | public const string GenAiResponseModelKey = "gen_ai.response.model"; |
| 25 | |
| 26 | public const string GenAiSystemKey = "gen_ai.system"; |
| 27 | public const string GenAiSystemValue = "openai"; |
| 28 | |
| 29 | public const string GenAiTokenTypeKey = "gen_ai.token.type"; |
| 30 | |
| 31 | public const string GenAiUsageInputTokensKey = "gen_ai.usage.input_tokens"; |
| 32 | public const string GenAiUsageOutputTokensKey = "gen_ai.usage.output_tokens"; |
| 33 | } |
| 34 | |