constants.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Copyright (c) 2017 Uber Technologies, Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package jaeger
  15. import (
  16. "fmt"
  17. "github.com/opentracing/opentracing-go"
  18. )
  19. const (
  20. // JaegerClientVersion is the version of the client library reported as Span tag.
  21. JaegerClientVersion = "Go-2.30.0"
  22. // JaegerClientVersionTagKey is the name of the tag used to report client version.
  23. JaegerClientVersionTagKey = "jaeger.version"
  24. // JaegerDebugHeader is the name of HTTP header or a TextMap carrier key which,
  25. // if found in the carrier, forces the trace to be sampled as "debug" trace.
  26. // The value of the header is recorded as the tag on the root span, so that the
  27. // trace can be found in the UI using this value as a correlation ID.
  28. JaegerDebugHeader = "jaeger-debug-id"
  29. // JaegerBaggageHeader is the name of the HTTP header that is used to submit baggage.
  30. // It differs from TraceBaggageHeaderPrefix in that it can be used only in cases where
  31. // a root span does not exist.
  32. JaegerBaggageHeader = "jaeger-baggage"
  33. // TracerHostnameTagKey used to report host name of the process.
  34. TracerHostnameTagKey = "hostname"
  35. // TracerIPTagKey used to report ip of the process.
  36. TracerIPTagKey = "ip"
  37. // TracerUUIDTagKey used to report UUID of the client process.
  38. TracerUUIDTagKey = "client-uuid"
  39. // SamplerTypeTagKey reports which sampler was used on the root span.
  40. SamplerTypeTagKey = "sampler.type"
  41. // SamplerParamTagKey reports the parameter of the sampler, like sampling probability.
  42. SamplerParamTagKey = "sampler.param"
  43. // TraceContextHeaderName is the http header name used to propagate tracing context.
  44. // This must be in lower-case to avoid mismatches when decoding incoming headers.
  45. TraceContextHeaderName = "uber-trace-id"
  46. // TracerStateHeaderName is deprecated.
  47. // Deprecated: use TraceContextHeaderName
  48. TracerStateHeaderName = TraceContextHeaderName
  49. // TraceBaggageHeaderPrefix is the prefix for http headers used to propagate baggage.
  50. // This must be in lower-case to avoid mismatches when decoding incoming headers.
  51. TraceBaggageHeaderPrefix = "uberctx-"
  52. // SamplerTypeConst is the type of sampler that always makes the same decision.
  53. SamplerTypeConst = "const"
  54. // SamplerTypeRemote is the type of sampler that polls Jaeger agent for sampling strategy.
  55. SamplerTypeRemote = "remote"
  56. // SamplerTypeProbabilistic is the type of sampler that samples traces
  57. // with a certain fixed probability.
  58. SamplerTypeProbabilistic = "probabilistic"
  59. // SamplerTypeRateLimiting is the type of sampler that samples
  60. // only up to a fixed number of traces per second.
  61. SamplerTypeRateLimiting = "ratelimiting"
  62. // SamplerTypeLowerBound is the type of sampler that samples
  63. // at least a fixed number of traces per second.
  64. SamplerTypeLowerBound = "lowerbound"
  65. // DefaultUDPSpanServerHost is the default host to send the spans to, via UDP
  66. DefaultUDPSpanServerHost = "localhost"
  67. // DefaultUDPSpanServerPort is the default port to send the spans to, via UDP
  68. DefaultUDPSpanServerPort = 6831
  69. // DefaultSamplingServerPort is the default port to fetch sampling config from, via http
  70. DefaultSamplingServerPort = 5778
  71. // DefaultMaxTagValueLength is the default max length of byte array or string allowed in the tag value.
  72. DefaultMaxTagValueLength = 256
  73. // SelfRefType is a jaeger specific reference type that supports creating a span
  74. // with an already defined context.
  75. selfRefType opentracing.SpanReferenceType = 99
  76. )
  77. var (
  78. // DefaultSamplingServerURL is the default url to fetch sampling config from, via http
  79. DefaultSamplingServerURL = fmt.Sprintf("http://127.0.0.1:%d/sampling", DefaultSamplingServerPort)
  80. )