From 7e355080ce51f54452e19706da96527a6c4d6a34 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 12:13:58 -0800
Subject: [PATCH 01/26] app/vmauth: pass the target url to reverse proxy via
context.Value instead of request header
This is less hacky way, since it doesn't clash with request headers
---
app/vmauth/main.go | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/app/vmauth/main.go b/app/vmauth/main.go
index b60823c64..8f5aa4fe1 100644
--- a/app/vmauth/main.go
+++ b/app/vmauth/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "context"
"flag"
"fmt"
"net/http"
@@ -99,15 +100,17 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
httpserver.Errorf(w, r, "cannot determine targetURL: %s", err)
return true
}
- r.Header.Set("vm-target-url", targetURL.String())
for _, h := range headers {
r.Header.Set(h.Name, h.Value)
}
+ ctx := context.WithValue(r.Context(), targetURLKey, targetURL)
+ r = r.WithContext(ctx)
proxyRequest(w, r)
return true
}
func proxyRequest(w http.ResponseWriter, r *http.Request) {
+ reverseProxyOnce.Do(initReverseProxy)
defer func() {
err := recover()
if err == nil || err == http.ErrAbortHandler {
@@ -118,7 +121,7 @@ func proxyRequest(w http.ResponseWriter, r *http.Request) {
// Forward other panics to the caller.
panic(err)
}()
- getReverseProxy().ServeHTTP(w, r)
+ reverseProxy.ServeHTTP(w, r)
}
var (
@@ -132,21 +135,12 @@ var (
reverseProxyOnce sync.Once
)
-func getReverseProxy() *httputil.ReverseProxy {
- reverseProxyOnce.Do(initReverseProxy)
- return reverseProxy
-}
-
// initReverseProxy must be called after flag.Parse(), since it uses command-line flags.
func initReverseProxy() {
reverseProxy = &httputil.ReverseProxy{
Director: func(r *http.Request) {
- targetURL := r.Header.Get("vm-target-url")
- target, err := url.Parse(targetURL)
- if err != nil {
- logger.Panicf("BUG: unexpected error when parsing targetURL=%q: %s", targetURL, err)
- }
- r.URL = target
+ targetURL := r.Context().Value(targetURLKey).(*url.URL)
+ r.URL = targetURL
},
Transport: func() *http.Transport {
tr := http.DefaultTransport.(*http.Transport).Clone()
@@ -165,6 +159,8 @@ func initReverseProxy() {
}
}
+var targetURLKey interface{} = "vm-target-url"
+
func usage() {
const s = `
vmauth authenticates and authorizes incoming requests and proxies them to VictoriaMetrics.
From 1b81d8f5427827b4cbdf53f635943c223650c78b Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 13:24:30 -0800
Subject: [PATCH 02/26] lib/netutil: move IsTrivialNetworkError() function
there, since it is used in multiple places across the code
---
app/vmselect/bufferedwriter/bufferedwriter.go | 16 ++++------------
lib/httpserver/httpserver.go | 14 +++-----------
lib/netutil/netutil.go | 15 +++++++++++++++
3 files changed, 22 insertions(+), 23 deletions(-)
create mode 100644 lib/netutil/netutil.go
diff --git a/app/vmselect/bufferedwriter/bufferedwriter.go b/app/vmselect/bufferedwriter/bufferedwriter.go
index a06e59ecb..5e25d6ab3 100644
--- a/app/vmselect/bufferedwriter/bufferedwriter.go
+++ b/app/vmselect/bufferedwriter/bufferedwriter.go
@@ -4,8 +4,9 @@ import (
"bufio"
"fmt"
"io"
- "strings"
"sync"
+
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/netutil"
)
// Get returns buffered writer for the given w.
@@ -63,7 +64,7 @@ func (bw *Writer) Write(p []byte) (int, error) {
return 0, bw.err
}
n, err := bw.bw.Write(p)
- if err != nil && !isTrivialNetworkError(err) {
+ if err != nil && !netutil.IsTrivialNetworkError(err) {
bw.err = fmt.Errorf("cannot send %d bytes to client: %w", len(p), err)
}
return n, bw.err
@@ -76,7 +77,7 @@ func (bw *Writer) Flush() error {
if bw.err != nil {
return bw.err
}
- if err := bw.bw.Flush(); err != nil && !isTrivialNetworkError(err) {
+ if err := bw.bw.Flush(); err != nil && !netutil.IsTrivialNetworkError(err) {
bw.err = fmt.Errorf("cannot flush data to client: %w", err)
}
return bw.err
@@ -88,12 +89,3 @@ func (bw *Writer) Error() error {
defer bw.lock.Unlock()
return bw.err
}
-
-func isTrivialNetworkError(err error) bool {
- // Suppress trivial network errors, which could occur at remote side.
- s := err.Error()
- if strings.Contains(s, "broken pipe") || strings.Contains(s, "reset by peer") {
- return true
- }
- return false
-}
diff --git a/lib/httpserver/httpserver.go b/lib/httpserver/httpserver.go
index 1668489ef..09a54c505 100644
--- a/lib/httpserver/httpserver.go
+++ b/lib/httpserver/httpserver.go
@@ -199,7 +199,7 @@ func gzipHandler(s *server, rh RequestHandler) http.HandlerFunc {
w = maybeGzipResponseWriter(w, r)
handlerWrapper(s, w, r, rh)
if zrw, ok := w.(*gzipResponseWriter); ok {
- if err := zrw.Close(); err != nil && !isTrivialNetworkError(err) {
+ if err := zrw.Close(); err != nil && !netutil.IsTrivialNetworkError(err) {
logger.Warnf("gzipResponseWriter.Close: %s", err)
}
}
@@ -503,10 +503,10 @@ func (zrw *gzipResponseWriter) Flush() {
_, _ = zrw.Write(nil)
}
if !zrw.disableCompression {
- if err := zrw.bw.Flush(); err != nil && !isTrivialNetworkError(err) {
+ if err := zrw.bw.Flush(); err != nil && !netutil.IsTrivialNetworkError(err) {
logger.Warnf("gzipResponseWriter.Flush (buffer): %s", err)
}
- if err := zrw.zw.Flush(); err != nil && !isTrivialNetworkError(err) {
+ if err := zrw.zw.Flush(); err != nil && !netutil.IsTrivialNetworkError(err) {
logger.Warnf("gzipResponseWriter.Flush (gzip): %s", err)
}
}
@@ -643,14 +643,6 @@ func (e *ErrorWithStatusCode) Error() string {
return e.Err.Error()
}
-func isTrivialNetworkError(err error) bool {
- s := err.Error()
- if strings.Contains(s, "broken pipe") || strings.Contains(s, "reset by peer") {
- return true
- }
- return false
-}
-
// IsTLS indicates is tls enabled or not
func IsTLS() bool {
return *tlsEnable
diff --git a/lib/netutil/netutil.go b/lib/netutil/netutil.go
new file mode 100644
index 000000000..91f72296c
--- /dev/null
+++ b/lib/netutil/netutil.go
@@ -0,0 +1,15 @@
+package netutil
+
+import (
+ "strings"
+)
+
+// IsTrivialNetworkError returns true if the err can be ignored during logging.
+func IsTrivialNetworkError(err error) bool {
+ // Suppress trivial network errors, which could occur at remote side.
+ s := err.Error()
+ if strings.Contains(s, "broken pipe") || strings.Contains(s, "reset by peer") {
+ return true
+ }
+ return false
+}
From 372b1688d73cd5b55d45ce390fe57c7defb07c72 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 13:38:13 -0800
Subject: [PATCH 03/26] app/vmauth: do not use net/http/httputil.ReverseProxy
This allows better controlling requests to backends and providing better error logging.
For example, if the backend was unavailable, then the ReverseProxy was logging the error
message without client ip and the initial request uri. This could harden debugging.
This is based on https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3486
---
app/vmauth/main.go | 164 ++++++++++++++++++++++++++++++++-------------
docs/CHANGELOG.md | 2 +
2 files changed, 119 insertions(+), 47 deletions(-)
diff --git a/app/vmauth/main.go b/app/vmauth/main.go
index 8f5aa4fe1..14e39d794 100644
--- a/app/vmauth/main.go
+++ b/app/vmauth/main.go
@@ -1,22 +1,24 @@
package main
import (
- "context"
"flag"
"fmt"
+ "io"
+ "net"
"net/http"
- "net/http/httputil"
- "net/url"
+ "net/textproto"
"os"
"strings"
"sync"
"time"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/envflag"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
+ "github.com/VictoriaMetrics/VictoriaMetrics/lib/netutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/procutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/pushmetrics"
"github.com/VictoriaMetrics/metrics"
@@ -27,6 +29,7 @@ var (
useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+
"See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt")
maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host")
+ responseTimeout = flag.Duration("responseTimeout", 5*time.Minute, "The timeout for receiving a response from backend")
reloadAuthKey = flag.String("reloadAuthKey", "", "Auth key for /-/reload http endpoint. It must be passed as authKey=...")
logInvalidAuthTokens = flag.Bool("logInvalidAuthTokens", false, "Whether to log requests with invalid auth tokens. "+
`Such requests are always counted at vmauth_http_request_errors_total{reason="invalid_auth_token"} metric, which is exposed at /metrics page`)
@@ -86,11 +89,15 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
ui := ac[authToken]
if ui == nil {
invalidAuthTokenRequests.Inc()
+ err := fmt.Errorf("cannot find the provided auth token %q in config", authToken)
if *logInvalidAuthTokens {
- httpserver.Errorf(w, r, "cannot find the provided auth token %q in config", authToken)
+ err = &httpserver.ErrorWithStatusCode{
+ Err: err,
+ StatusCode: http.StatusUnauthorized,
+ }
+ httpserver.Errorf(w, r, "%s", err)
} else {
- errStr := fmt.Sprintf("cannot find the provided auth token %q in config", authToken)
- http.Error(w, errStr, http.StatusBadRequest)
+ http.Error(w, err.Error(), http.StatusUnauthorized)
}
return true
}
@@ -100,28 +107,103 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
httpserver.Errorf(w, r, "cannot determine targetURL: %s", err)
return true
}
+
+ // This code has been copied from net/http/httputil/reverseproxy.go
+ req := sanitizeRequestHeaders(r)
+ req.URL = targetURL
for _, h := range headers {
- r.Header.Set(h.Name, h.Value)
+ req.Header.Set(h.Name, h.Value)
}
- ctx := context.WithValue(r.Context(), targetURLKey, targetURL)
- r = r.WithContext(ctx)
- proxyRequest(w, r)
+ transportOnce.Do(transportInit)
+ res, err := transport.RoundTrip(req)
+ if err != nil {
+ err = &httpserver.ErrorWithStatusCode{
+ Err: fmt.Errorf("error when proxying the request to %q: %s", targetURL, err),
+ StatusCode: http.StatusBadGateway,
+ }
+ httpserver.Errorf(w, r, "%s", err)
+ return true
+ }
+ removeHopHeaders(res.Header)
+ copyHeader(w.Header(), res.Header)
+ w.WriteHeader(res.StatusCode)
+
+ copyBuf := copyBufPool.Get()
+ copyBuf.B = bytesutil.ResizeNoCopyNoOverallocate(copyBuf.B, 16*1024)
+ _, err = io.CopyBuffer(w, res.Body, copyBuf.B)
+ copyBufPool.Put(copyBuf)
+ _ = res.Body.Close()
+ if err != nil && !netutil.IsTrivialNetworkError(err) {
+ remoteAddr := httpserver.GetQuotedRemoteAddr(r)
+ requestURI := httpserver.GetRequestURI(r)
+ logger.Warnf("remoteAddr: %s; requestURI: %s; error when proxying response body from %s: %s", remoteAddr, requestURI, targetURL, err)
+ return true
+ }
+
return true
}
-func proxyRequest(w http.ResponseWriter, r *http.Request) {
- reverseProxyOnce.Do(initReverseProxy)
- defer func() {
- err := recover()
- if err == nil || err == http.ErrAbortHandler {
- // Suppress http.ErrAbortHandler panic.
- // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1353
- return
+var copyBufPool bytesutil.ByteBufferPool
+
+func copyHeader(dst, src http.Header) {
+ for k, vv := range src {
+ for _, v := range vv {
+ dst.Add(k, v)
}
- // Forward other panics to the caller.
- panic(err)
- }()
- reverseProxy.ServeHTTP(w, r)
+ }
+}
+
+func sanitizeRequestHeaders(r *http.Request) *http.Request {
+ // This code has been copied from net/http/httputil/reverseproxy.go
+ req := r.Clone(r.Context())
+ removeHopHeaders(req.Header)
+ if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil {
+ // If we aren't the first proxy retain prior
+ // X-Forwarded-For information as a comma+space
+ // separated list and fold multiple headers into one.
+ prior := req.Header["X-Forwarded-For"]
+ if len(prior) > 0 {
+ clientIP = strings.Join(prior, ", ") + ", " + clientIP
+ }
+ req.Header.Set("X-Forwarded-For", clientIP)
+ }
+ return req
+}
+
+func removeHopHeaders(h http.Header) {
+ // remove hop-by-hop headers listed in the "Connection" header of h.
+ // See RFC 7230, section 6.1
+ for _, f := range h["Connection"] {
+ for _, sf := range strings.Split(f, ",") {
+ if sf = textproto.TrimString(sf); sf != "" {
+ h.Del(sf)
+ }
+ }
+ }
+
+ // Remove hop-by-hop headers to the backend. Especially
+ // important is "Connection" because we want a persistent
+ // connection, regardless of what the client sent to us.
+ for _, key := range hopHeaders {
+ h.Del(key)
+ }
+}
+
+// Hop-by-hop headers. These are removed when sent to the backend.
+// As of RFC 7230, hop-by-hop headers are required to appear in the
+// Connection header field. These are the headers defined by the
+// obsoleted RFC 2616 (section 13.5.1) and are used for backward
+// compatibility.
+var hopHeaders = []string{
+ "Connection",
+ "Proxy-Connection", // non-standard but still sent by libcurl and rejected by e.g. google
+ "Keep-Alive",
+ "Proxy-Authenticate",
+ "Proxy-Authorization",
+ "Te", // canonicalized version of "TE"
+ "Trailer", // not Trailers per URL above; https://www.rfc-editor.org/errata_search.php?eid=4522
+ "Transfer-Encoding",
+ "Upgrade",
}
var (
@@ -131,36 +213,24 @@ var (
)
var (
- reverseProxy *httputil.ReverseProxy
- reverseProxyOnce sync.Once
+ transport *http.Transport
+ transportOnce sync.Once
)
-// initReverseProxy must be called after flag.Parse(), since it uses command-line flags.
-func initReverseProxy() {
- reverseProxy = &httputil.ReverseProxy{
- Director: func(r *http.Request) {
- targetURL := r.Context().Value(targetURLKey).(*url.URL)
- r.URL = targetURL
- },
- Transport: func() *http.Transport {
- tr := http.DefaultTransport.(*http.Transport).Clone()
- // Automatic compression must be disabled in order to fix https://github.com/VictoriaMetrics/VictoriaMetrics/issues/535
- tr.DisableCompression = true
- // Disable HTTP/2.0, since VictoriaMetrics components don't support HTTP/2.0 (because there is no sense in this).
- tr.ForceAttemptHTTP2 = false
- tr.MaxIdleConnsPerHost = *maxIdleConnsPerBackend
- if tr.MaxIdleConns != 0 && tr.MaxIdleConns < tr.MaxIdleConnsPerHost {
- tr.MaxIdleConns = tr.MaxIdleConnsPerHost
- }
- return tr
- }(),
- FlushInterval: time.Second,
- ErrorLog: logger.StdErrorLogger(),
+func transportInit() {
+ tr := http.DefaultTransport.(*http.Transport).Clone()
+ tr.ResponseHeaderTimeout = *responseTimeout
+ // Automatic compression must be disabled in order to fix https://github.com/VictoriaMetrics/VictoriaMetrics/issues/535
+ tr.DisableCompression = true
+ // Disable HTTP/2.0, since VictoriaMetrics components don't support HTTP/2.0 (because there is no sense in this).
+ tr.ForceAttemptHTTP2 = false
+ tr.MaxIdleConnsPerHost = *maxIdleConnsPerBackend
+ if tr.MaxIdleConns != 0 && tr.MaxIdleConns < tr.MaxIdleConnsPerHost {
+ tr.MaxIdleConns = tr.MaxIdleConnsPerHost
}
+ transport = tr
}
-var targetURLKey interface{} = "vm-target-url"
-
func usage() {
const s = `
vmauth authenticates and authorizes incoming requests and proxies them to VictoriaMetrics.
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 363b6aa9e..cb28cd6de 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -27,6 +27,8 @@ The following tip changes can be tested by building VictoriaMetrics components f
* BUGFIX: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): propagate all the timeout-related errors from `vmstorage` to `vmselect` when `vmstorage`. Previously some timeout errors weren't returned from `vmselect` to `vmstorage`. Instead, `vmstorage` could log the error and close the connection to `vmselect`, so `vmselect` was logging cryptic errors such as `cannot execute funcName="..." on vmstorage "...": EOF`.
* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): add support for time zone selection for older versions of browsers. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3680).
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): update API version for [ec2_sd_configs](https://docs.victoriametrics.com/sd_configs.html#ec2_sd_configs) to fix [the issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3700) with missing `__meta_ec2_availability_zone_id` attribute.
+* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): allow re-entering authorization info in the web browser if the entered info was incorrect. Previously it was non-trivial to do via the web browser, since `vmauth` was returning `400 Bad Request` instead of `401 Unauthorized` http response code.
+* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): always log the client address and the requested URL on proxying errors. Previously some errors could miss this information.
## [v1.86.2](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.86.2)
From ff39a9114786aaf82682bdb574eedee561b5f969 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 14:06:42 -0800
Subject: [PATCH 04/26] app/vmauth: limit the number of concurrent requests
served by `vmauth` with the `-maxConcurrentRequests` command-line flag
See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3346
This commit is based on the https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3486
---
app/vmauth/main.go | 56 +++++++++++++++++++++++++++++++++++++++-------
docs/CHANGELOG.md | 1 +
2 files changed, 49 insertions(+), 8 deletions(-)
diff --git a/app/vmauth/main.go b/app/vmauth/main.go
index 14e39d794..c68d6e8ef 100644
--- a/app/vmauth/main.go
+++ b/app/vmauth/main.go
@@ -7,6 +7,7 @@ import (
"net"
"net/http"
"net/textproto"
+ "net/url"
"os"
"strings"
"sync"
@@ -28,10 +29,13 @@ var (
httpListenAddr = flag.String("httpListenAddr", ":8427", "TCP address to listen for http connections. See also -httpListenAddr.useProxyProtocol")
useProxyProtocol = flag.Bool("httpListenAddr.useProxyProtocol", false, "Whether to use proxy protocol for connections accepted at -httpListenAddr . "+
"See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt")
- maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host")
- responseTimeout = flag.Duration("responseTimeout", 5*time.Minute, "The timeout for receiving a response from backend")
- reloadAuthKey = flag.String("reloadAuthKey", "", "Auth key for /-/reload http endpoint. It must be passed as authKey=...")
- logInvalidAuthTokens = flag.Bool("logInvalidAuthTokens", false, "Whether to log requests with invalid auth tokens. "+
+ maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host. "+
+ "See also -maxConcurrentRequests")
+ responseTimeout = flag.Duration("responseTimeout", 5*time.Minute, "The timeout for receiving a response from backend")
+ maxConcurrentRequests = flag.Int("maxConcurrentRequests", 1000, "The maximum number of concurrent requests vmauth can process. Other requests are rejected with "+
+ "'429 Too Many Requests' http status code. See also -maxIdleConnsPerBackend")
+ reloadAuthKey = flag.String("reloadAuthKey", "", "Auth key for /-/reload http endpoint. It must be passed as authKey=...")
+ logInvalidAuthTokens = flag.Bool("logInvalidAuthTokens", false, "Whether to log requests with invalid auth tokens. "+
`Such requests are always counted at vmauth_http_request_errors_total{reason="invalid_auth_token"} metric, which is exposed at /metrics page`)
)
@@ -85,6 +89,7 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
// See https://docs.influxdata.com/influxdb/v2.0/api/
authToken = strings.Replace(authToken, "Token", "Bearer", 1)
}
+
ac := authConfig.Load().(map[string]*UserInfo)
ui := ac[authToken]
if ui == nil {
@@ -108,6 +113,26 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
return true
}
+ // Limit the concurrency of requests to backends
+ concurrencyLimitOnce.Do(concurrencyLimitInit)
+ select {
+ case concurrencyLimitCh <- struct{}{}:
+ default:
+ concurrentRequestsLimitReachedTotal.Inc()
+ w.Header().Add("Retry-After", "10")
+ err := &httpserver.ErrorWithStatusCode{
+ Err: fmt.Errorf("cannot serve more than -maxConcurrentRequests=%d concurrent requests", cap(concurrencyLimitCh)),
+ StatusCode: http.StatusTooManyRequests,
+ }
+ httpserver.Errorf(w, r, "%s", err)
+ return true
+ }
+ processRequest(w, r, targetURL, headers)
+ <-concurrencyLimitCh
+ return true
+}
+
+func processRequest(w http.ResponseWriter, r *http.Request, targetURL *url.URL, headers []Header) {
// This code has been copied from net/http/httputil/reverseproxy.go
req := sanitizeRequestHeaders(r)
req.URL = targetURL
@@ -122,7 +147,7 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
StatusCode: http.StatusBadGateway,
}
httpserver.Errorf(w, r, "%s", err)
- return true
+ return
}
removeHopHeaders(res.Header)
copyHeader(w.Header(), res.Header)
@@ -137,10 +162,8 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
remoteAddr := httpserver.GetQuotedRemoteAddr(r)
requestURI := httpserver.GetRequestURI(r)
logger.Warnf("remoteAddr: %s; requestURI: %s; error when proxying response body from %s: %s", remoteAddr, requestURI, targetURL, err)
- return true
+ return
}
-
- return true
}
var copyBufPool bytesutil.ByteBufferPool
@@ -231,6 +254,23 @@ func transportInit() {
transport = tr
}
+var (
+ concurrencyLimitCh chan struct{}
+ concurrencyLimitOnce sync.Once
+)
+
+func concurrencyLimitInit() {
+ concurrencyLimitCh = make(chan struct{}, *maxConcurrentRequests)
+ _ = metrics.NewGauge("vmauth_concurrent_requests_capacity", func() float64 {
+ return float64(*maxConcurrentRequests)
+ })
+ _ = metrics.NewGauge("vmauth_concurrent_requests_current", func() float64 {
+ return float64(len(concurrencyLimitCh))
+ })
+}
+
+var concurrentRequestsLimitReachedTotal = metrics.NewCounter("vmauth_concurrent_requests_limit_reached_total")
+
func usage() {
const s = `
vmauth authenticates and authorizes incoming requests and proxies them to VictoriaMetrics.
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index cb28cd6de..6ccd3c842 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -20,6 +20,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): improve visual appearance of the top menu. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3678).
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): embed fonts into binary instead of loading them from external sources. This allows using `vmui` in full from isolated networks without access to Internet. Thanks to @ScottKevill for [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3696).
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): reduce memory usage when sending stale markers for targets, which expose big number of metrics. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3668) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3675) issues.
+* FEATURE: [vmauth](https://docs.victoriametrics.com/vmauth.html): allow limiting the number of concurrent requests sent to `vmauth` via `-maxConcurrentRequests` command-line flag. This allows controlling memory usage of `vmauth` and the resource usage of backends behind `vmauth`. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3346). Thanks to @dmitryk-dk for [the initial implementation](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3486).
* FEATURE: allow using VictoriaMetrics components behind proxies, which communicate with the backend via [proxy protocol](https://www.haproxy.org/download/2.3/doc/proxy-protocol.txt). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). For example, [vmauth](https://docs.victoriametrics.com/vmauth.html) accepts proxy protocol connections when it starts with `-httpListenAddr.useProxyProtocol` command-line flag.
* FEATURE: add `-internStringMaxLen` command-line flag, which can be used for fine-tuning RAM vs CPU usage in certain workloads. For example, if the stored time series contain long labels, then it may be useful reducing the `-internStringMaxLen` in order to reduce memory usage at the cost of increased CPU usage. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3692).
From a0c8b86eab7cf9c3975bf7f9017cb8cd4881a6bf Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 14:10:01 -0800
Subject: [PATCH 05/26] docs/vmauth.md: update docs after
ff39a9114786aaf82682bdb574eedee561b5f969
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3346
---
app/vmauth/README.md | 6 +++++-
docs/vmauth.md | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/app/vmauth/README.md b/app/vmauth/README.md
index aa384cdbc..693d211dd 100644
--- a/app/vmauth/README.md
+++ b/app/vmauth/README.md
@@ -284,8 +284,10 @@ See the docs at https://docs.victoriametrics.com/vmauth.html .
Timezone to use for timestamps in logs. Timezone must be a valid IANA Time Zone. For example: America/New_York, Europe/Berlin, Etc/GMT+3 or Local (default "UTC")
-loggerWarnsPerSecondLimit int
Per-second limit on the number of WARN messages. If more than the given number of warns are emitted per second, then the remaining warns are suppressed. Zero values disable the rate limit
+ -maxConcurrentRequests int
+ The maximum number of concurrent requests vmauth can process. Other requests are rejected with '429 Too Many Requests' http status code. See also -maxIdleConnsPerBackend (default 1000)
-maxIdleConnsPerBackend int
- The maximum number of idle connections vmauth can open per each backend host (default 100)
+ The maximum number of idle connections vmauth can open per each backend host. See also -maxConcurrentRequests (default 100)
-memory.allowedBytes size
Allowed size of system memory VictoriaMetrics caches may occupy. This option overrides -memory.allowedPercent if set to a non-zero value. Too low a value may increase the cache miss rate usually resulting in higher CPU and disk IO usage. Too high a value may evict too much data from OS page cache resulting in higher disk IO usage
Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 0)
@@ -305,6 +307,8 @@ See the docs at https://docs.victoriametrics.com/vmauth.html .
Supports an array of values separated by comma or specified via multiple flags.
-reloadAuthKey string
Auth key for /-/reload http endpoint. It must be passed as authKey=...
+ -responseTimeout duration
+ The timeout for receiving a response from backend (default 5m0s)
-tls
Whether to enable TLS for incoming HTTP requests at -httpListenAddr (aka https). -tlsCertFile and -tlsKeyFile must be set if -tls is set
-tlsCertFile string
diff --git a/docs/vmauth.md b/docs/vmauth.md
index d905f06f4..0d5dfbefa 100644
--- a/docs/vmauth.md
+++ b/docs/vmauth.md
@@ -288,8 +288,10 @@ See the docs at https://docs.victoriametrics.com/vmauth.html .
Timezone to use for timestamps in logs. Timezone must be a valid IANA Time Zone. For example: America/New_York, Europe/Berlin, Etc/GMT+3 or Local (default "UTC")
-loggerWarnsPerSecondLimit int
Per-second limit on the number of WARN messages. If more than the given number of warns are emitted per second, then the remaining warns are suppressed. Zero values disable the rate limit
+ -maxConcurrentRequests int
+ The maximum number of concurrent requests vmauth can process. Other requests are rejected with '429 Too Many Requests' http status code. See also -maxIdleConnsPerBackend (default 1000)
-maxIdleConnsPerBackend int
- The maximum number of idle connections vmauth can open per each backend host (default 100)
+ The maximum number of idle connections vmauth can open per each backend host. See also -maxConcurrentRequests (default 100)
-memory.allowedBytes size
Allowed size of system memory VictoriaMetrics caches may occupy. This option overrides -memory.allowedPercent if set to a non-zero value. Too low a value may increase the cache miss rate usually resulting in higher CPU and disk IO usage. Too high a value may evict too much data from OS page cache resulting in higher disk IO usage
Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 0)
@@ -309,6 +311,8 @@ See the docs at https://docs.victoriametrics.com/vmauth.html .
Supports an array of values separated by comma or specified via multiple flags.
-reloadAuthKey string
Auth key for /-/reload http endpoint. It must be passed as authKey=...
+ -responseTimeout duration
+ The timeout for receiving a response from backend (default 5m0s)
-tls
Whether to enable TLS for incoming HTTP requests at -httpListenAddr (aka https). -tlsCertFile and -tlsKeyFile must be set if -tls is set
-tlsCertFile string
From 06f6b765217fa75a6d1dbb32d4bb810629ea10ee Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 14:37:04 -0800
Subject: [PATCH 06/26] app/vmagent: properly return 200 response code when
importing data via Prometheus PushGateway protocol
This is the same fix as has been already applied to app/vminsert at cdb6d651e93c102b67b5c1aa178ff0343bb6e112
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3636
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1415
---
app/vmagent/main.go | 9 ++++++++-
docs/CHANGELOG.md | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/app/vmagent/main.go b/app/vmagent/main.go
index 4ffca3f7d..7b01e734c 100644
--- a/app/vmagent/main.go
+++ b/app/vmagent/main.go
@@ -236,7 +236,14 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
httpserver.Errorf(w, r, "%s", err)
return true
}
- w.WriteHeader(http.StatusNoContent)
+ statusCode := http.StatusNoContent
+ if strings.HasPrefix(path, "/prometheus/api/v1/import/prometheus/metrics/job/") ||
+ strings.HasPrefix(path, "/api/v1/import/prometheus/metrics/job/") {
+ // Return 200 status code for pushgateway requests.
+ // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3636
+ statusCode = http.StatusOK
+ }
+ w.WriteHeader(statusCode)
return true
}
if strings.HasPrefix(path, "datadog/") {
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 6ccd3c842..0ef2f96dc 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -28,6 +28,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
* BUGFIX: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): propagate all the timeout-related errors from `vmstorage` to `vmselect` when `vmstorage`. Previously some timeout errors weren't returned from `vmselect` to `vmstorage`. Instead, `vmstorage` could log the error and close the connection to `vmselect`, so `vmselect` was logging cryptic errors such as `cannot execute funcName="..." on vmstorage "...": EOF`.
* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): add support for time zone selection for older versions of browsers. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3680).
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): update API version for [ec2_sd_configs](https://docs.victoriametrics.com/sd_configs.html#ec2_sd_configs) to fix [the issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3700) with missing `__meta_ec2_availability_zone_id` attribute.
+* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): properly return `200 OK` HTTP status code when importing data via [Pushgateway protocol](https://docs.victoriametrics.com/#how-to-import-data-in-prometheus-exposition-format). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3636).
* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): allow re-entering authorization info in the web browser if the entered info was incorrect. Previously it was non-trivial to do via the web browser, since `vmauth` was returning `400 Bad Request` instead of `401 Unauthorized` http response code.
* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): always log the client address and the requested URL on proxying errors. Previously some errors could miss this information.
From bd716d1b0cda860f090fcf0d882dec35e0ebcfd5 Mon Sep 17 00:00:00 2001
From: Denys Holius <5650611+denisgolius@users.noreply.github.com>
Date: Sat, 28 Jan 2023 01:22:21 +0200
Subject: [PATCH 07/26] Improving docs by adding additional security sections
(#3713)
* docs/Cluster-VictoriaMetrics.md: adds security section
* docs/Quick-Start.md: adds Security recommendation section
---
docs/Cluster-VictoriaMetrics.md | 24 ++++++++++++++++++++++++
docs/Quick-Start.md | 6 ++++++
2 files changed, 30 insertions(+)
diff --git a/docs/Cluster-VictoriaMetrics.md b/docs/Cluster-VictoriaMetrics.md
index 7a474efa9..df713cc4c 100644
--- a/docs/Cluster-VictoriaMetrics.md
+++ b/docs/Cluster-VictoriaMetrics.md
@@ -237,6 +237,30 @@ for sending data from `vminsert` to `vmstorage` node according to `-vminsertAddr
The currently discovered `vmstorage` nodes can be [monitored](#monitoring) with `vm_rpc_vmstorage_is_reachable` and `vm_rpc_vmstorage_is_read_only` metrics.
+## Security
+
+General security recommendations:
+
+- All the VictoriaMetrics components must run in protected private networks without direct access from untrusted networks such as Internet. The exception is [vmauth](https://docs.victoriametrics.com/vmauth.html) and [vmgateway](https://docs.victoriametrics.com/vmgateway.html).
+- All the requests from untrusted networks to VictoriaMetrics components must go through auth proxy such as vmauth or vmgateway. The proxy must be set up with proper authentication and authorization.
+- Prefer using lists of allowed API endpoints, while disallowing access to other endpoints when configuring auth proxy in front of VictoriaMetrics components.
+
+VictoriaMetrics Cluster provides the following security-related command-line flags:
+
+* `-tls`, `-tlsCertFile` and `-tlsKeyFile` for switching from HTTP to HTTPS.
+* `-httpAuth.username` and `-httpAuth.password` for protecting all the HTTP endpoints
+ with [HTTP Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication).
+* `-snapshotAuthKey` for protecting `/snapshot*` endpoints. See [how to work with snapshots](https://docs.victoriametrics.com/#how-to-work-with-snapshots) and [backups](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#backups).
+* `-forceMergeAuthKey` for protecting `/internal/force_merge` endpoint. See [force merge docs](https://docs.victoriametrics.com/#forced-merge).
+* `-search.resetCacheAuthKey` for protecting `/internal/resetRollupResultCache` endpoint. See [backfilling](https://docs.victoriametrics.com/#backfilling) for more details.
+* `-flagsAuthKey` for protecting `/flags` endpoint.
+* `-pprofAuthKey` for protecting `/debug/pprof/*` endpoints, which can be used for [profiling](https://docs.victoriametrics.com/#profiling).
+* `-denyQueryTracing` for disallowing [query tracing](https://docs.victoriametrics.com/#query-tracing).
+
+VictoriaMetrics Cluster supports [multiple isolated tenants](#multitenancy) (aka namespaces) and do not provide flag `-deleteAuthKey` to secure time series from deletion via API. It is strongly recommend to use [vmauth](https://docs.victoriametrics.com/vmauth.html) or [vmgateway](https://docs.victoriametrics.com/vmgateway.html) to protect `/delete//prometheus/api/v1/admin/tsdb/delete_series`.
+
+VictoriaMetrics has achieved security certifications for Database Software Development and Software-Based Monitoring Services. We apply strict security measures in everything we do. See our [Security page](https://victoriametrics.com/security/) for more details.
+
## mTLS protection
By default `vminsert` and `vmselect` nodes use unencrypted connections to `vmstorage` nodes, since it is assumed that all the cluster components run in a protected environment. [Enterprise version of VictoriaMetrics](https://docs.victoriametrics.com/enterprise.html) provides optional support for [mTLS connections](https://en.wikipedia.org/wiki/Mutual_authentication#mTLS) between cluster components. Pass `-cluster.tls=true` command-line flag to `vminsert`, `vmselect` and `vmstorage` nodes in order to enable mTLS protection. Additionally, `vminsert`, `vmselect` and `vmstorage` must be configured with mTLS certificates via `-cluster.tlsCertFile`, `-cluster.tlsKeyFile` command-line options. These certificates are mutually verified when `vminsert` and `vmselect` dial `vmstorage`.
diff --git a/docs/Quick-Start.md b/docs/Quick-Start.md
index bb09feb57..94c9bf7de 100644
--- a/docs/Quick-Start.md
+++ b/docs/Quick-Start.md
@@ -174,3 +174,9 @@ and [backups](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.htm
To avoid excessive resource usage or performance degradation limits must be in place:
* [Resource usage limits](https://docs.victoriametrics.com/FAQ.html#how-to-set-a-memory-limit-for-victoriametrics-components);
* [Cardinality limiter](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#cardinality-limiter).
+
+### Security recommendation
+
+Enabling HTTPS encrypts the communication between clients and the VictoriaMetrics database. HTTPS can also verify the authenticity of the VictoriaMetrics database to connecting clients. General security recommendations for:
+* [Single node](https://docs.victoriametrics.com/#security)
+* [Cluster version](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#security)
\ No newline at end of file
From 51ad94677c3bc36fac6827203c796e13d0d6fa11 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 15:39:27 -0800
Subject: [PATCH 08/26] docs: update security chapters after
bd716d1b0cda860f090fcf0d882dec35e0ebcfd5
---
README.md | 4 +++-
docs/Cluster-VictoriaMetrics.md | 32 +++++++++++----------------
docs/Quick-Start.md | 7 +++---
docs/README.md | 4 +++-
docs/Single-server-VictoriaMetrics.md | 4 +++-
5 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md
index 004ebc646..b1b845225 100644
--- a/README.md
+++ b/README.md
@@ -1616,7 +1616,9 @@ VictoriaMetrics provides the following security-related command-line flags:
Explicitly set internal network interface for TCP and UDP ports for data ingestion with Graphite and OpenTSDB formats.
For example, substitute `-graphiteListenAddr=:2003` with `-graphiteListenAddr=:2003`. This protects from unexpected requests from untrusted network interfaces.
-VictoriaMetrics has achieved security certifications for Database Software Development and Software-Based Monitoring Services. We apply strict security measures in everything we do. See our [Security page](https://victoriametrics.com/security/) for more details.
+See also [security recommendation for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#security)
+and [the general security page at VictoriaMetrics website](https://victoriametrics.com/security/).
+
## Tuning
diff --git a/docs/Cluster-VictoriaMetrics.md b/docs/Cluster-VictoriaMetrics.md
index df713cc4c..47d40c2d9 100644
--- a/docs/Cluster-VictoriaMetrics.md
+++ b/docs/Cluster-VictoriaMetrics.md
@@ -37,7 +37,9 @@ Each service may scale independently and may run on the most suitable hardware.
This is a [shared nothing architecture](https://en.wikipedia.org/wiki/Shared-nothing_architecture).
It increases cluster availability, and simplifies cluster maintenance as well as cluster scaling.
-![Naive cluster scheme](Cluster-VictoriaMetrics_cluster-scheme.png)
+
+ {headerSetup?.tenant && }
{headerSetup?.stepControl && }
{headerSetup?.timeSelector && }
{headerSetup?.cardinalityDatePicker && }
diff --git a/app/vmui/packages/vmui/src/components/Main/Icons/index.tsx b/app/vmui/packages/vmui/src/components/Main/Icons/index.tsx
index e1b5bf842..072d5601b 100644
--- a/app/vmui/packages/vmui/src/components/Main/Icons/index.tsx
+++ b/app/vmui/packages/vmui/src/components/Main/Icons/index.tsx
@@ -389,3 +389,14 @@ export const QuestionIcon = () => (
);
+
+export const StorageIcons = () => (
+
+);
diff --git a/app/vmui/packages/vmui/src/components/Main/Modal/style.scss b/app/vmui/packages/vmui/src/components/Main/Modal/style.scss
index 4fe29df92..ba740d76a 100644
--- a/app/vmui/packages/vmui/src/components/Main/Modal/style.scss
+++ b/app/vmui/packages/vmui/src/components/Main/Modal/style.scss
@@ -8,7 +8,7 @@ $padding-modal: 22px;
left: 0;
right: 0;
bottom: 0;
- z-index: 999;
+ z-index: 100;
display: flex;
align-items: center;
justify-content: center;
diff --git a/app/vmui/packages/vmui/src/router/index.ts b/app/vmui/packages/vmui/src/router/index.ts
index 83cfb1d59..becc31ad2 100644
--- a/app/vmui/packages/vmui/src/router/index.ts
+++ b/app/vmui/packages/vmui/src/router/index.ts
@@ -11,6 +11,7 @@ const router = {
export interface RouterOptions {
title?: string,
header: {
+ tenant?: boolean,
stepControl?: boolean,
timeSelector?: boolean,
executionControls?: boolean,
@@ -21,6 +22,7 @@ export interface RouterOptions {
const routerOptionsDefault = {
header: {
+ tenant: true,
stepControl: true,
timeSelector: true,
executionControls: true,
@@ -35,6 +37,7 @@ export const routerOptions: {[key: string]: RouterOptions} = {
[router.metrics]: {
title: "Explore metrics",
header: {
+ tenant: true,
stepControl: true,
timeSelector: true,
}
@@ -42,12 +45,15 @@ export const routerOptions: {[key: string]: RouterOptions} = {
[router.cardinality]: {
title: "Explore cardinality",
header: {
+ tenant: true,
cardinalityDatePicker: true,
}
},
[router.topQueries]: {
title: "Top queries",
- header: {}
+ header: {
+ tenant: true,
+ }
},
[router.trace]: {
title: "Trace analyzer",
diff --git a/app/vmui/packages/vmui/src/state/common/reducer.ts b/app/vmui/packages/vmui/src/state/common/reducer.ts
index 50f520faa..6e91978e9 100644
--- a/app/vmui/packages/vmui/src/state/common/reducer.ts
+++ b/app/vmui/packages/vmui/src/state/common/reducer.ts
@@ -4,18 +4,20 @@ import { getFromStorage, saveToStorage } from "../../utils/storage";
export interface AppState {
serverUrl: string;
- tenantId: number;
+ tenantId: string;
darkTheme: boolean
}
export type Action =
| { type: "SET_SERVER", payload: string }
- | { type: "SET_TENANT_ID", payload: number }
| { type: "SET_DARK_THEME", payload: boolean }
+ | { type: "SET_TENANT_ID", payload: string }
+
+const tenantId = getQueryStringValue("g0.tenantID", "") as string;
export const initialState: AppState = {
- serverUrl: getDefaultServer(),
- tenantId: Number(getQueryStringValue("g0.tenantID", 0)),
+ serverUrl: getDefaultServer(tenantId),
+ tenantId,
darkTheme: !!getFromStorage("DARK_THEME")
};
diff --git a/app/vmui/packages/vmui/src/utils/default-server-url.ts b/app/vmui/packages/vmui/src/utils/default-server-url.ts
index 5cdb25128..bbb8f145c 100644
--- a/app/vmui/packages/vmui/src/utils/default-server-url.ts
+++ b/app/vmui/packages/vmui/src/utils/default-server-url.ts
@@ -1,6 +1,13 @@
import { getAppModeParams } from "./app-mode";
-export const getDefaultServer = (): string => {
+export const getDefaultServer = (tenantId?: string): string => {
const { serverURL } = getAppModeParams();
- return serverURL || window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/, "/prometheus");
+ const url = serverURL || window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/, "/prometheus");
+ if (tenantId) return replaceTenantId(url, tenantId);
+ return url;
+};
+
+export const replaceTenantId = (serverUrl: string, tenantId: string) => {
+ const regexp = /(\/select\/)(\d+|\d.+)(\/)(.+)/;
+ return serverUrl.replace(regexp, `$1${tenantId}/$4`);
};
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 0ef2f96dc..7a25885a2 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -19,6 +19,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): add dark mode - it can be seleted via `settings` menu in the top right corner. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3704).
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): improve visual appearance of the top menu. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3678).
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): embed fonts into binary instead of loading them from external sources. This allows using `vmui` in full from isolated networks without access to Internet. Thanks to @ScottKevill for [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3696).
+* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): add ability to switch between tenants by selecting the needed tenant in the drop-down list at the top right corner of the UI. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3673).
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): reduce memory usage when sending stale markers for targets, which expose big number of metrics. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3668) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3675) issues.
* FEATURE: [vmauth](https://docs.victoriametrics.com/vmauth.html): allow limiting the number of concurrent requests sent to `vmauth` via `-maxConcurrentRequests` command-line flag. This allows controlling memory usage of `vmauth` and the resource usage of backends behind `vmauth`. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3346). Thanks to @dmitryk-dk for [the initial implementation](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3486).
* FEATURE: allow using VictoriaMetrics components behind proxies, which communicate with the backend via [proxy protocol](https://www.haproxy.org/download/2.3/doc/proxy-protocol.txt). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). For example, [vmauth](https://docs.victoriametrics.com/vmauth.html) accepts proxy protocol connections when it starts with `-httpListenAddr.useProxyProtocol` command-line flag.
From 6a7faf9f2228fb559cb0bffb71097e6d8fde4043 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 15:57:38 -0800
Subject: [PATCH 10/26] vendor: `make vendor-update`
---
go.mod | 22 +-
go.sum | 45 ++--
.../go/compute/internal/version.go | 2 +-
.../aws/aws-sdk-go-v2/config/CHANGELOG.md | 8 +
.../config/go_module_metadata.go | 2 +-
.../aws-sdk-go-v2/credentials/CHANGELOG.md | 8 +
.../credentials/go_module_metadata.go | 2 +-
.../feature/s3/manager/CHANGELOG.md | 8 +
.../feature/s3/manager/go_module_metadata.go | 2 +-
.../aws/aws-sdk-go-v2/service/s3/CHANGELOG.md | 4 +
.../service/s3/go_module_metadata.go | 2 +-
.../s3/internal/endpoints/endpoints.go | 9 +
.../aws-sdk-go-v2/service/sts/CHANGELOG.md | 8 +
.../service/sts/api_op_AssumeRole.go | 11 +-
.../service/sts/api_op_GetFederationToken.go | 15 +-
.../service/sts/go_module_metadata.go | 2 +-
.../sts/internal/endpoints/endpoints.go | 3 +
.../aws/aws-sdk-go/aws/endpoints/defaults.go | 233 ++++++++++++++++++
.../github.com/aws/aws-sdk-go/aws/version.go | 2 +-
.../protocol/jsonrpc/unmarshal_error.go | 11 +-
.../aws/aws-sdk-go/service/sts/api.go | 17 +-
.../grpc/balancer/grpclb/grpclb.go | 2 +-
.../grpclb/{grpclbstate => state}/state.go | 8 +-
.../internal/resolver/dns/dns_resolver.go | 2 +-
vendor/google.golang.org/grpc/version.go | 2 +-
vendor/modules.txt | 26 +-
26 files changed, 372 insertions(+), 84 deletions(-)
rename vendor/google.golang.org/grpc/balancer/grpclb/{grpclbstate => state}/state.go (87%)
diff --git a/go.mod b/go.mod
index df2581a21..28d3fa5a0 100644
--- a/go.mod
+++ b/go.mod
@@ -14,9 +14,9 @@ require (
github.com/VictoriaMetrics/metrics v1.23.1
github.com/VictoriaMetrics/metricsql v0.51.2
github.com/aws/aws-sdk-go-v2 v1.17.3
- github.com/aws/aws-sdk-go-v2/config v1.18.8
- github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.47
- github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0
+ github.com/aws/aws-sdk-go-v2/config v1.18.10
+ github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.49
+ github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1
github.com/cespare/xxhash/v2 v2.2.0
github.com/cheggaaa/pb/v3 v3.1.0
github.com/gogo/protobuf v1.3.2
@@ -41,15 +41,15 @@ require (
require (
cloud.google.com/go v0.109.0 // indirect
- cloud.google.com/go/compute v1.15.1 // indirect
+ cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
- github.com/aws/aws-sdk-go v1.44.184 // indirect
+ github.com/aws/aws-sdk-go v1.44.189 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
- github.com/aws/aws-sdk-go-v2/credentials v1.13.8 // indirect
+ github.com/aws/aws-sdk-go-v2/credentials v1.13.10 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 // indirect
@@ -61,13 +61,13 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0 // indirect
- github.com/aws/aws-sdk-go-v2/service/sts v1.18.0 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sts v1.18.2 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dennwc/varint v1.0.0 // indirect
- github.com/fatih/color v1.14.0 // indirect
+ github.com/fatih/color v1.14.1 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
@@ -106,14 +106,14 @@ require (
go.opentelemetry.io/otel/trace v1.11.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/goleak v1.2.0 // indirect
- golang.org/x/exp v0.0.0-20230118134722-a68e582fa157 // indirect
+ golang.org/x/exp v0.0.0-20230127193734-31bee513bff7 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/genproto v0.0.0-20230119192704-9d59e20e5cd1 // indirect
- google.golang.org/grpc v1.52.0 // indirect
+ google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa // indirect
+ google.golang.org/grpc v1.52.3 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/go.sum b/go.sum
index 960be729f..e8bd4d261 100644
--- a/go.sum
+++ b/go.sum
@@ -21,8 +21,8 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
-cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE=
-cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA=
+cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY=
+cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
@@ -87,20 +87,20 @@ github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu
github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo=
github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
-github.com/aws/aws-sdk-go v1.44.184 h1:/MggyE66rOImXJKl1HqhLQITvWvqIV7w1Q4MaG6FHUo=
-github.com/aws/aws-sdk-go v1.44.184/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.44.189 h1:9PBrjndH1uL5AN8818qI3duhQ4hgkMuLvqkJlg9MRyk=
+github.com/aws/aws-sdk-go v1.44.189/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.17.3 h1:shN7NlnVzvDUgPQ+1rLMSxY8OWRNDRYtiqe0p/PgrhY=
github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno=
-github.com/aws/aws-sdk-go-v2/config v1.18.8 h1:lDpy0WM8AHsywOnVrOHaSMfpaiV2igOw8D7svkFkXVA=
-github.com/aws/aws-sdk-go-v2/config v1.18.8/go.mod h1:5XCmmyutmzzgkpk/6NYTjeWb6lgo9N170m1j6pQkIBs=
-github.com/aws/aws-sdk-go-v2/credentials v1.13.8 h1:vTrwTvv5qAwjWIGhZDSBH/oQHuIQjGmD232k01FUh6A=
-github.com/aws/aws-sdk-go-v2/credentials v1.13.8/go.mod h1:lVa4OHbvgjVot4gmh1uouF1ubgexSCN92P6CJQpT0t8=
+github.com/aws/aws-sdk-go-v2/config v1.18.10 h1:Znce11DWswdh+5kOsIp+QaNfY9igp1QUN+fZHCKmeCI=
+github.com/aws/aws-sdk-go-v2/config v1.18.10/go.mod h1:VATKco+pl+Qe1WW+RzvZTlPPe/09Gg9+vM0ZXsqb16k=
+github.com/aws/aws-sdk-go-v2/credentials v1.13.10 h1:T4Y39IhelTLg1f3xiKJssThnFxsndS8B6OnmcXtKK+8=
+github.com/aws/aws-sdk-go-v2/credentials v1.13.10/go.mod h1:tqAm4JmQaShel+Qi38hmd1QglSnnxaYt50k/9yGQzzc=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 h1:j9wi1kQ8b+e0FBVHxCqCGo4kxDU175hoDHcWAi0sauU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21/go.mod h1:ugwW57Z5Z48bpvUyZuaPy4Kv+vEfJWnIrky7RmkBvJg=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.47 h1:E884ndKWVGt8IhtUuGhXbEsmaCvdAAkTTUDu7uAok1g=
-github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.47/go.mod h1:KybsEsmXLO0u75FyS3F0sY4OQ97syDe8z+ISq8oEczA=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.49 h1:zPFhadkmXbXu3RVXTPU4HVW+g2DStMY+01cJaj//+Cw=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.49/go.mod h1:N9gSChQkKpdAj7vRpfKma4ND88zoZM+v6W2lJgWrDh4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 h1:I3cakv2Uy1vNmmhRQmFptYDxOvBnwCdNwyw63N0RaRU=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 h1:5NbbMrIzmUn/TXFqAle6mgrH5m9cOvMLRGL7pnG8tRE=
@@ -117,14 +117,14 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 h1:5C6XgTViS
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21/go.mod h1:lRToEJsn+DRA9lW4O9L9+/3hjTkUzlzyzHqn8MTds5k=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21 h1:vY5siRXvW5TrOKm2qKEf9tliBfdLxdfy0i02LOcmqUo=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21/go.mod h1:WZvNXT1XuH8dnJM0HvOlvk+RNn7NbAPvA/ACO0QarSc=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0 h1:wddsyuESfviaiXk3w9N6/4iRwTg/a3gktjODY6jYQBo=
-github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0/go.mod h1:L2l2/q76teehcW7YEsgsDjqdsDTERJeX3nOMIFlgGUE=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1 h1:kIgvVY7PHx4gIb0na/Q9gTWJWauTwhKdaqJjX8PkIY8=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1/go.mod h1:L2l2/q76teehcW7YEsgsDjqdsDTERJeX3nOMIFlgGUE=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.0 h1:/2gzjhQowRLarkkBOGPXSRnb8sQ2RVsjdG1C/UliK/c=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.0/go.mod h1:wo/B7uUm/7zw/dWhBJ4FXuw1sySU5lyIhVg1Bu2yL9A=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0 h1:Jfly6mRxk2ZOSlbCvZfKNS7TukSx1mIzhSsqZ/IGSZI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0/go.mod h1:TZSH7xLO7+phDtViY/KUp9WGCJMQkLJ/VpgkTFd5gh8=
-github.com/aws/aws-sdk-go-v2/service/sts v1.18.0 h1:kOO++CYo50RcTFISESluhWEi5Prhg+gaSs4whWabiZU=
-github.com/aws/aws-sdk-go-v2/service/sts v1.18.0/go.mod h1:+lGbb3+1ugwKrNTWcf2RT05Xmp543B06zDFTwiTLp7I=
+github.com/aws/aws-sdk-go-v2/service/sts v1.18.2 h1:J/4wIaGInCEYCGhTSruxCxeoA5cy91a+JT7cHFKFSHQ=
+github.com/aws/aws-sdk-go-v2/service/sts v1.18.2/go.mod h1:+lGbb3+1ugwKrNTWcf2RT05Xmp543B06zDFTwiTLp7I=
github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8=
github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -166,8 +166,8 @@ github.com/envoyproxy/go-control-plane v0.10.3 h1:xdCVXxEe0Y3FQith+0cj2irwZudqGY
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
-github.com/fatih/color v1.14.0 h1:AD//feEuOKJSzxN81txMW47CNX1EW6kMVEPt4lePhtE=
-github.com/fatih/color v1.14.0/go.mod h1:Ywr2WOhTEN4nsWMWU8I8GWIG5z8rhJEa0ukvJDOfSPY=
+github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
+github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
@@ -483,8 +483,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20230118134722-a68e582fa157 h1:fiNkyhJPUvxbRPbCqY/D9qdjmPzfHcpK3P4bM4gioSY=
-golang.org/x/exp v0.0.0-20230118134722-a68e582fa157/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
+golang.org/x/exp v0.0.0-20230127193734-31bee513bff7 h1:pXR8mGh4q8ooBT7HXruL4Xa2IxoL8XZ6lOgXY/0Ryg8=
+golang.org/x/exp v0.0.0-20230127193734-31bee513bff7/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -611,7 +611,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -738,8 +737,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20230119192704-9d59e20e5cd1 h1:wSjSSQW7LuPdv3m1IrSN33nVxH/kID6OIKy+FMwGB2k=
-google.golang.org/genproto v0.0.0-20230119192704-9d59e20e5cd1/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
+google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa h1:GZXdWYIKckxQE2EcLHLvF+KLF+bIwoxGdMUxTZizueg=
+google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -753,8 +752,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
-google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk=
-google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
+google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ=
+google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
diff --git a/vendor/cloud.google.com/go/compute/internal/version.go b/vendor/cloud.google.com/go/compute/internal/version.go
index 7dd6a0aa8..ddddbd21f 100644
--- a/vendor/cloud.google.com/go/compute/internal/version.go
+++ b/vendor/cloud.google.com/go/compute/internal/version.go
@@ -15,4 +15,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "1.15.1"
+const Version = "1.18.0"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md
index 04278678e..89de5f650 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.18.10 (2023-01-25)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.18.9 (2023-01-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.18.8 (2023-01-05)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go
index 89734b1eb..069b55b3a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go
@@ -3,4 +3,4 @@
package config
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.18.8"
+const goModuleVersion = "1.18.10"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md
index 91d150e6a..13a5b85c0 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.13.10 (2023-01-25)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.13.9 (2023-01-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.13.8 (2023-01-05)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go
index 8cbe05de6..ad901369b 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go
@@ -3,4 +3,4 @@
package credentials
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.13.8"
+const goModuleVersion = "1.13.10"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md
index 387f93540..08575458c 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.11.49 (2023-01-25)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.11.48 (2023-01-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
# v1.11.47 (2023-01-05)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go
index 015448748..20e0cba4e 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go
@@ -3,4 +3,4 @@
package manager
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.11.47"
+const goModuleVersion = "1.11.49"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md
index cab26896f..cd3a6da8a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.30.1 (2023-01-23)
+
+* No change notes available for this release.
+
# v1.30.0 (2023-01-05)
* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go
index 21dcc59c2..0a46ef685 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go
@@ -3,4 +3,4 @@
package s3
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.30.0"
+const goModuleVersion = "1.30.1"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go
index 5fca8c1d4..dc0215c99 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go
@@ -239,6 +239,15 @@ var defaultPartitions = endpoints.Partitions{
}: {
Hostname: "s3.dualstack.ap-southeast-3.amazonaws.com",
},
+ endpoints.EndpointKey{
+ Region: "ap-southeast-4",
+ }: endpoints.Endpoint{},
+ endpoints.EndpointKey{
+ Region: "ap-southeast-4",
+ Variant: endpoints.DualStackVariant,
+ }: {
+ Hostname: "s3.dualstack.ap-southeast-4.amazonaws.com",
+ },
endpoints.EndpointKey{
Region: "aws-global",
}: endpoints.Endpoint{
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
index e624d601e..fe16b2d4d 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
@@ -1,3 +1,11 @@
+# v1.18.2 (2023-01-25)
+
+* **Documentation**: Doc only change to update wording in a key topic
+
+# v1.18.1 (2023-01-23)
+
+* No change notes available for this release.
+
# v1.18.0 (2023-01-05)
* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
index f4f4f46f4..4cbb046b6 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
@@ -12,12 +12,11 @@ import (
)
// Returns a set of temporary security credentials that you can use to access
-// Amazon Web Services resources that you might not normally have access to. These
-// temporary credentials consist of an access key ID, a secret access key, and a
-// security token. Typically, you use AssumeRole within your account or for
-// cross-account access. For a comparison of AssumeRole with other API operations
-// that produce temporary credentials, see Requesting Temporary Security
-// Credentials
+// Amazon Web Services resources. These temporary credentials consist of an access
+// key ID, a secret access key, and a security token. Typically, you use AssumeRole
+// within your account or for cross-account access. For a comparison of AssumeRole
+// with other API operations that produce temporary credentials, see Requesting
+// Temporary Security Credentials
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
// and Comparing the Amazon Web Services STS API operations
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
index 60026a139..8acb5acaa 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
@@ -43,16 +43,17 @@ import (
// Temporary credentials obtained by using the Amazon Web Services account root
// user credentials have a maximum duration of 3,600 seconds (1 hour). Permissions
// You can use the temporary credentials created by GetFederationToken in any
-// Amazon Web Services service except the following:
+// Amazon Web Services service with the following exceptions:
//
-// * You cannot call any IAM
-// operations using the CLI or the Amazon Web Services API.
+// * You cannot call
+// any IAM operations using the CLI or the Amazon Web Services API. This limitation
+// does not apply to console sessions.
//
-// * You cannot call any
-// STS operations except GetCallerIdentity.
+// * You cannot call any STS operations except
+// GetCallerIdentity.
//
-// You must pass an inline or managed
-// session policy
+// You can use temporary credentials for single sign-on (SSO)
+// to the console. You must pass an inline or managed session policy
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
index 2755e647e..366239c5a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
@@ -3,4 +3,4 @@
package sts
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.18.0"
+const goModuleVersion = "1.18.2"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
index ce9acedcd..1f99a0209 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
@@ -165,6 +165,9 @@ var defaultPartitions = endpoints.Partitions{
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
+ endpoints.EndpointKey{
+ Region: "ap-southeast-4",
+ }: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "aws-global",
}: endpoints.Endpoint{
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
index ed5a19dfe..4cb781fed 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
@@ -27,6 +27,7 @@ const (
ApSoutheast1RegionID = "ap-southeast-1" // Asia Pacific (Singapore).
ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney).
ApSoutheast3RegionID = "ap-southeast-3" // Asia Pacific (Jakarta).
+ ApSoutheast4RegionID = "ap-southeast-4" // Asia Pacific (Melbourne).
CaCentral1RegionID = "ca-central-1" // Canada (Central).
EuCentral1RegionID = "eu-central-1" // Europe (Frankfurt).
EuCentral2RegionID = "eu-central-2" // Europe (Zurich).
@@ -172,6 +173,9 @@ var awsPartition = partition{
"ap-southeast-3": region{
Description: "Asia Pacific (Jakarta)",
},
+ "ap-southeast-4": region{
+ Description: "Asia Pacific (Melbourne)",
+ },
"ca-central-1": region{
Description: "Canada (Central)",
},
@@ -261,6 +265,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -432,6 +439,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -935,6 +945,15 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -1168,6 +1187,14 @@ var awsPartition = partition{
Region: "ap-southeast-3",
},
},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{
+ Hostname: "api.ecr.ap-southeast-4.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-4",
+ },
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{
@@ -2096,6 +2123,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -2287,6 +2317,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -2493,6 +2526,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -3550,6 +3586,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -4018,12 +4057,32 @@ var awsPartition = partition{
},
"cases": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-east-1",
+ }: endpoint{
+
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-2",
+ }: endpoint{
+
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
+ }: endpoint{},
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
+ }: endpoint{},
},
},
"cassandra": service{
@@ -4291,6 +4350,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -4479,6 +4541,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -4760,6 +4825,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -5240,6 +5308,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -6292,6 +6363,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -7443,6 +7517,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -7607,6 +7684,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -7683,6 +7763,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -8191,6 +8274,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -8357,6 +8443,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -8525,6 +8614,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -8712,6 +8804,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -9020,6 +9115,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -9760,6 +9858,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -9908,6 +10009,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -10463,6 +10567,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -10614,6 +10721,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -11627,6 +11737,9 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
endpointKey{
Region: "me-south-1",
}: endpoint{},
@@ -14226,6 +14339,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -14649,6 +14765,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "kms-fips.ap-southeast-4.amazonaws.com",
+ },
endpointKey{
Region: "ap-southeast-4-fips",
}: endpoint{
@@ -15167,6 +15292,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "lambda.ap-southeast-3.api.aws",
},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "lambda.ap-southeast-4.api.aws",
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -15823,6 +15957,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -16931,6 +17068,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -17410,6 +17550,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -18027,6 +18170,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -18647,6 +18793,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -19644,6 +19793,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -19801,6 +19953,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -20202,6 +20357,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -20739,6 +20897,11 @@ var awsPartition = partition{
}: endpoint{
Hostname: "resource-explorer-2.ap-southeast-2.api.aws",
},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{
+ Hostname: "resource-explorer-2.ap-southeast-4.api.aws",
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{
@@ -20821,6 +20984,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -20830,18 +20996,27 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -21571,6 +21746,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "s3.dualstack.ap-southeast-3.amazonaws.com",
},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3.dualstack.ap-southeast-4.amazonaws.com",
+ },
endpointKey{
Region: "aws-global",
}: endpoint{
@@ -22660,6 +22844,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -24433,6 +24620,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -24581,6 +24771,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -24726,6 +24919,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -25075,6 +25271,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -25235,12 +25434,18 @@ var awsPartition = partition{
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -25382,6 +25587,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -25474,6 +25682,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "aws-global",
}: endpoint{
@@ -25650,6 +25861,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -25792,6 +26006,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -25934,6 +26151,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -28380,6 +28600,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -30650,6 +30873,9 @@ var awsusgovPartition = partition{
},
},
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
@@ -36588,6 +36814,13 @@ var awsisobPartition = partition{
}: endpoint{},
},
},
+ "dlm": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ },
+ },
"dms": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{},
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go
index 32befe5d6..9e8856ba5 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/version.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "1.44.184"
+const SDKVersion = "1.44.189"
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go
index 4f933f2a1..9c1ccde54 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go
@@ -22,7 +22,7 @@ const (
// UnmarshalTypedError provides unmarshaling errors API response errors
// for both typed and untyped errors.
type UnmarshalTypedError struct {
- exceptions map[string]func(protocol.ResponseMetadata) error
+ exceptions map[string]func(protocol.ResponseMetadata) error
queryExceptions map[string]func(protocol.ResponseMetadata, string) error
}
@@ -30,11 +30,13 @@ type UnmarshalTypedError struct {
// set of exception names to the error unmarshalers
func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError {
return &UnmarshalTypedError{
- exceptions: exceptions,
+ exceptions: exceptions,
queryExceptions: map[string]func(protocol.ResponseMetadata, string) error{},
}
}
+// NewUnmarshalTypedErrorWithOptions works similar to NewUnmarshalTypedError applying options to the UnmarshalTypedError
+// before returning it
func NewUnmarshalTypedErrorWithOptions(exceptions map[string]func(protocol.ResponseMetadata) error, optFns ...func(*UnmarshalTypedError)) *UnmarshalTypedError {
unmarshaledError := NewUnmarshalTypedError(exceptions)
for _, fn := range optFns {
@@ -43,6 +45,11 @@ func NewUnmarshalTypedErrorWithOptions(exceptions map[string]func(protocol.Respo
return unmarshaledError
}
+// WithQueryCompatibility is a helper function to construct a functional option for use with NewUnmarshalTypedErrorWithOptions.
+// The queryExceptions given act as an override for unmarshalling errors when query compatible error codes are found.
+// See also [awsQueryCompatible trait]
+//
+// [awsQueryCompatible trait]: https://smithy.io/2.0/aws/protocols/aws-query-protocol.html#aws-protocols-awsquerycompatible-trait
func WithQueryCompatibility(queryExceptions map[string]func(protocol.ResponseMetadata, string) error) func(*UnmarshalTypedError) {
return func(typedError *UnmarshalTypedError) {
typedError.queryExceptions = queryExceptions
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
index c0706bec9..63729d0a7 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
@@ -56,12 +56,11 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
// AssumeRole API operation for AWS Security Token Service.
//
// Returns a set of temporary security credentials that you can use to access
-// Amazon Web Services resources that you might not normally have access to.
-// These temporary credentials consist of an access key ID, a secret access
-// key, and a security token. Typically, you use AssumeRole within your account
-// or for cross-account access. For a comparison of AssumeRole with other API
-// operations that produce temporary credentials, see Requesting Temporary Security
-// Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
+// Amazon Web Services resources. These temporary credentials consist of an
+// access key ID, a secret access key, and a security token. Typically, you
+// use AssumeRole within your account or for cross-account access. For a comparison
+// of AssumeRole with other API operations that produce temporary credentials,
+// see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide.
//
@@ -1103,13 +1102,15 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
// # Permissions
//
// You can use the temporary credentials created by GetFederationToken in any
-// Amazon Web Services service except the following:
+// Amazon Web Services service with the following exceptions:
//
// - You cannot call any IAM operations using the CLI or the Amazon Web Services
-// API.
+// API. This limitation does not apply to console sessions.
//
// - You cannot call any STS operations except GetCallerIdentity.
//
+// You can use temporary credentials for single sign-on (SSO) to the console.
+//
// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
diff --git a/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go b/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go
index b0dd72fce..dd15810d0 100644
--- a/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go
+++ b/vendor/google.golang.org/grpc/balancer/grpclb/grpclb.go
@@ -32,7 +32,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/balancer"
- "google.golang.org/grpc/balancer/grpclb/grpclbstate"
+ grpclbstate "google.golang.org/grpc/balancer/grpclb/state"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
diff --git a/vendor/google.golang.org/grpc/balancer/grpclb/grpclbstate/state.go b/vendor/google.golang.org/grpc/balancer/grpclb/state/state.go
similarity index 87%
rename from vendor/google.golang.org/grpc/balancer/grpclb/grpclbstate/state.go
rename to vendor/google.golang.org/grpc/balancer/grpclb/state/state.go
index cece046be..4ecfa1c21 100644
--- a/vendor/google.golang.org/grpc/balancer/grpclb/grpclbstate/state.go
+++ b/vendor/google.golang.org/grpc/balancer/grpclb/state/state.go
@@ -16,9 +16,9 @@
*
*/
-// Package grpclbstate declares grpclb types to be set by resolvers wishing to
-// pass information to grpclb via resolver.State Attributes.
-package grpclbstate
+// Package state declares grpclb types to be set by resolvers wishing to pass
+// information to grpclb via resolver.State Attributes.
+package state
import (
"google.golang.org/grpc/resolver"
@@ -27,7 +27,7 @@ import (
// keyType is the key to use for storing State in Attributes.
type keyType string
-const key = keyType("grpc.grpclb.grpclbstate")
+const key = keyType("grpc.grpclb.state")
// State contains gRPCLB-relevant data passed from the name resolver.
type State struct {
diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go
index d51302e65..b08ac30ad 100644
--- a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go
+++ b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go
@@ -32,7 +32,7 @@ import (
"sync"
"time"
- grpclbstate "google.golang.org/grpc/balancer/grpclb/grpclbstate"
+ grpclbstate "google.golang.org/grpc/balancer/grpclb/state"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal/backoff"
"google.golang.org/grpc/internal/envconfig"
diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go
index 243e06e8d..6410a0b96 100644
--- a/vendor/google.golang.org/grpc/version.go
+++ b/vendor/google.golang.org/grpc/version.go
@@ -19,4 +19,4 @@
package grpc
// Version is the current grpc version.
-const Version = "1.52.0"
+const Version = "1.52.3"
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 3cef8b159..a3147efe8 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -4,7 +4,7 @@ cloud.google.com/go/internal
cloud.google.com/go/internal/optional
cloud.google.com/go/internal/trace
cloud.google.com/go/internal/version
-# cloud.google.com/go/compute v1.15.1
+# cloud.google.com/go/compute v1.18.0
## explicit; go 1.19
cloud.google.com/go/compute/internal
# cloud.google.com/go/compute/metadata v0.2.3
@@ -80,7 +80,7 @@ github.com/VividCortex/ewma
# github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
## explicit; go 1.15
github.com/alecthomas/units
-# github.com/aws/aws-sdk-go v1.44.184
+# github.com/aws/aws-sdk-go v1.44.189
## explicit; go 1.11
github.com/aws/aws-sdk-go/aws
github.com/aws/aws-sdk-go/aws/awserr
@@ -149,10 +149,10 @@ github.com/aws/aws-sdk-go-v2/internal/timeconv
## explicit; go 1.15
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi
-# github.com/aws/aws-sdk-go-v2/config v1.18.8
+# github.com/aws/aws-sdk-go-v2/config v1.18.10
## explicit; go 1.15
github.com/aws/aws-sdk-go-v2/config
-# github.com/aws/aws-sdk-go-v2/credentials v1.13.8
+# github.com/aws/aws-sdk-go-v2/credentials v1.13.10
## explicit; go 1.15
github.com/aws/aws-sdk-go-v2/credentials
github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds
@@ -165,7 +165,7 @@ github.com/aws/aws-sdk-go-v2/credentials/stscreds
## explicit; go 1.15
github.com/aws/aws-sdk-go-v2/feature/ec2/imds
github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config
-# github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.47
+# github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.49
## explicit; go 1.15
github.com/aws/aws-sdk-go-v2/feature/s3/manager
# github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27
@@ -196,7 +196,7 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
github.com/aws/aws-sdk-go-v2/service/internal/s3shared
github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn
github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config
-# github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0
+# github.com/aws/aws-sdk-go-v2/service/s3 v1.30.1
## explicit; go 1.15
github.com/aws/aws-sdk-go-v2/service/s3
github.com/aws/aws-sdk-go-v2/service/s3/internal/arn
@@ -213,7 +213,7 @@ github.com/aws/aws-sdk-go-v2/service/sso/types
github.com/aws/aws-sdk-go-v2/service/ssooidc
github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints
github.com/aws/aws-sdk-go-v2/service/ssooidc/types
-# github.com/aws/aws-sdk-go-v2/service/sts v1.18.0
+# github.com/aws/aws-sdk-go-v2/service/sts v1.18.2
## explicit; go 1.15
github.com/aws/aws-sdk-go-v2/service/sts
github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints
@@ -258,8 +258,8 @@ github.com/davecgh/go-spew/spew
# github.com/dennwc/varint v1.0.0
## explicit; go 1.12
github.com/dennwc/varint
-# github.com/fatih/color v1.14.0
-## explicit; go 1.13
+# github.com/fatih/color v1.14.1
+## explicit; go 1.17
github.com/fatih/color
# github.com/felixge/httpsnoop v1.0.3
## explicit; go 1.13
@@ -525,7 +525,7 @@ go.uber.org/atomic
## explicit; go 1.18
go.uber.org/goleak
go.uber.org/goleak/internal/stack
-# golang.org/x/exp v0.0.0-20230118134722-a68e582fa157
+# golang.org/x/exp v0.0.0-20230127193734-31bee513bff7
## explicit; go 1.18
golang.org/x/exp/constraints
golang.org/x/exp/slices
@@ -605,7 +605,7 @@ google.golang.org/appengine/internal/socket
google.golang.org/appengine/internal/urlfetch
google.golang.org/appengine/socket
google.golang.org/appengine/urlfetch
-# google.golang.org/genproto v0.0.0-20230119192704-9d59e20e5cd1
+# google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa
## explicit; go 1.19
google.golang.org/genproto/googleapis/api
google.golang.org/genproto/googleapis/api/annotations
@@ -615,7 +615,7 @@ google.golang.org/genproto/googleapis/rpc/errdetails
google.golang.org/genproto/googleapis/rpc/status
google.golang.org/genproto/googleapis/type/date
google.golang.org/genproto/googleapis/type/expr
-# google.golang.org/grpc v1.52.0
+# google.golang.org/grpc v1.52.3
## explicit; go 1.17
google.golang.org/grpc
google.golang.org/grpc/attributes
@@ -624,7 +624,7 @@ google.golang.org/grpc/balancer
google.golang.org/grpc/balancer/base
google.golang.org/grpc/balancer/grpclb
google.golang.org/grpc/balancer/grpclb/grpc_lb_v1
-google.golang.org/grpc/balancer/grpclb/grpclbstate
+google.golang.org/grpc/balancer/grpclb/state
google.golang.org/grpc/balancer/roundrobin
google.golang.org/grpc/binarylog/grpc_binarylog_v1
google.golang.org/grpc/channelz
From ab57b92932604158f1cbe228439e6b2cf1d91467 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 16:33:02 -0800
Subject: [PATCH 11/26] lib/promscrape/discovery/kubernetes: add support for
__meta_kubernetes_pod_container_id
See https://github.com/prometheus/prometheus/issues/11843
and https://github.com/prometheus/prometheus/pull/11844
---
docs/CHANGELOG.md | 1 +
docs/sd_configs.md | 3 +-
lib/promscrape/discovery/kubernetes/pod.go | 51 +++++++++++++++----
.../discovery/kubernetes/pod_test.go | 1 +
4 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 7a25885a2..4889b4a9b 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -23,6 +23,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): reduce memory usage when sending stale markers for targets, which expose big number of metrics. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3668) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3675) issues.
* FEATURE: [vmauth](https://docs.victoriametrics.com/vmauth.html): allow limiting the number of concurrent requests sent to `vmauth` via `-maxConcurrentRequests` command-line flag. This allows controlling memory usage of `vmauth` and the resource usage of backends behind `vmauth`. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3346). Thanks to @dmitryk-dk for [the initial implementation](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3486).
* FEATURE: allow using VictoriaMetrics components behind proxies, which communicate with the backend via [proxy protocol](https://www.haproxy.org/download/2.3/doc/proxy-protocol.txt). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). For example, [vmauth](https://docs.victoriametrics.com/vmauth.html) accepts proxy protocol connections when it starts with `-httpListenAddr.useProxyProtocol` command-line flag.
+* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add `__meta_kubernetes_pod_container_id` meta-label to the targets discovered via [kubernetes_sd_configs](https://docs.victoriametrics.com/sd_configs.html#kubernetes_sd_configs). This label has been added in Prometheus starting from `v2.42.0`. See [this feature request](https://github.com/prometheus/prometheus/issues/11843).
* FEATURE: add `-internStringMaxLen` command-line flag, which can be used for fine-tuning RAM vs CPU usage in certain workloads. For example, if the stored time series contain long labels, then it may be useful reducing the `-internStringMaxLen` in order to reduce memory usage at the cost of increased CPU usage. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3692).
* BUGFIX: fix a bug, which could prevent background merges for the previous partitions until restart if the storage didn't have enough disk space for final deduplication and down-sampling.
diff --git a/docs/sd_configs.md b/docs/sd_configs.md
index 05eab8677..a1f99ae35 100644
--- a/docs/sd_configs.md
+++ b/docs/sd_configs.md
@@ -788,7 +788,8 @@ One of the following `role` types can be configured to discover targets:
* `__meta_kubernetes_pod_labelpresent_`: "true" for each label from the pod object.
* `__meta_kubernetes_pod_annotation_`: Each annotation from the pod object.
* `__meta_kubernetes_pod_annotationpresent_`: "true" for each annotation from the pod object.
- * `__meta_kubernetes_pod_container_init`: "true" if the container is an InitContainer
+ * `__meta_kubernetes_pod_container_id`: ID of the container in the form `://`.
+ * `__meta_kubernetes_pod_container_init`: "true" if the container is an InitContainer.
* `__meta_kubernetes_pod_container_image`: Container image the target address points to.
* `__meta_kubernetes_pod_container_name`: Name of the container the target address points to.
* `__meta_kubernetes_pod_container_port_name`: Name of the container port.
diff --git a/lib/promscrape/discovery/kubernetes/pod.go b/lib/promscrape/discovery/kubernetes/pod.go
index 77c82f1df..7256c8b57 100644
--- a/lib/promscrape/discovery/kubernetes/pod.go
+++ b/lib/promscrape/discovery/kubernetes/pod.go
@@ -82,10 +82,12 @@ type ContainerPort struct {
//
// See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podstatus-v1-core
type PodStatus struct {
- Phase string
- PodIP string
- HostIP string
- Conditions []PodCondition
+ Phase string
+ PodIP string
+ HostIP string
+ Conditions []PodCondition
+ ContainerStatuses []ContainerStatus
+ InitContainerStatuses []ContainerStatus
}
// PodCondition implements k8s pod condition.
@@ -96,6 +98,27 @@ type PodCondition struct {
Status string
}
+// ContainerStatus implements k8s container status.
+//
+// See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#containerstatus-v1-core
+type ContainerStatus struct {
+ Name string
+ ContainerID string
+}
+
+func getContainerID(p *Pod, containerName string, isInit bool) string {
+ css := p.Status.ContainerStatuses
+ if isInit {
+ css = p.Status.InitContainerStatuses
+ }
+ for _, cs := range css {
+ if cs.Name == containerName {
+ return cs.ContainerID
+ }
+ }
+ return ""
+}
+
// getTargetLabels returns labels for each port of the given p.
//
// See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#pod
@@ -105,12 +128,12 @@ func (p *Pod) getTargetLabels(gw *groupWatcher) []*promutils.Labels {
return nil
}
var ms []*promutils.Labels
- ms = appendPodLabels(ms, gw, p, p.Spec.Containers, "false")
- ms = appendPodLabels(ms, gw, p, p.Spec.InitContainers, "true")
+ ms = appendPodLabels(ms, gw, p, p.Spec.Containers, false)
+ ms = appendPodLabels(ms, gw, p, p.Spec.InitContainers, true)
return ms
}
-func appendPodLabels(ms []*promutils.Labels, gw *groupWatcher, p *Pod, cs []Container, isInit string) []*promutils.Labels {
+func appendPodLabels(ms []*promutils.Labels, gw *groupWatcher, p *Pod, cs []Container, isInit bool) []*promutils.Labels {
for _, c := range cs {
for _, cp := range c.Ports {
ms = appendPodLabelsInternal(ms, gw, p, c, &cp, isInit)
@@ -122,14 +145,24 @@ func appendPodLabels(ms []*promutils.Labels, gw *groupWatcher, p *Pod, cs []Cont
return ms
}
-func appendPodLabelsInternal(ms []*promutils.Labels, gw *groupWatcher, p *Pod, c Container, cp *ContainerPort, isInit string) []*promutils.Labels {
+func appendPodLabelsInternal(ms []*promutils.Labels, gw *groupWatcher, p *Pod, c Container, cp *ContainerPort, isInit bool) []*promutils.Labels {
addr := p.Status.PodIP
if cp != nil {
addr = discoveryutils.JoinHostPort(addr, cp.ContainerPort)
}
m := promutils.GetLabels()
m.Add("__address__", addr)
- m.Add("__meta_kubernetes_pod_container_init", isInit)
+ isInitStr := "false"
+ if isInit {
+ isInitStr = "true"
+ }
+ m.Add("__meta_kubernetes_pod_container_init", isInitStr)
+
+ containerID := getContainerID(p, c.Name, isInit)
+ if containerID != "" {
+ m.Add("__meta_kubernetes_pod_container_id", containerID)
+ }
+
p.appendCommonLabels(m, gw)
p.appendContainerLabels(m, c, cp)
return append(ms, m)
diff --git a/lib/promscrape/discovery/kubernetes/pod_test.go b/lib/promscrape/discovery/kubernetes/pod_test.go
index 4311c29e6..2891a79b0 100644
--- a/lib/promscrape/discovery/kubernetes/pod_test.go
+++ b/lib/promscrape/discovery/kubernetes/pod_test.go
@@ -262,6 +262,7 @@ func TestParsePodListSuccess(t *testing.T) {
"__meta_kubernetes_pod_controller_kind": "Node",
"__meta_kubernetes_pod_controller_name": "m01",
"__meta_kubernetes_pod_container_init": "false",
+ "__meta_kubernetes_pod_container_id": "docker://a28f0800855008485376c1eece1cf61de97cb7026b9188d138b0d55d92fc2f5c",
"__meta_kubernetes_pod_label_component": "etcd",
"__meta_kubernetes_pod_label_tier": "control-plane",
From 0788be35eb5ccd659dc0bb7aa9d63ff2449f1c2f Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Fri, 27 Jan 2023 17:07:10 -0800
Subject: [PATCH 12/26] lib/promscrape/discovery/azure: add
__meta_azure_machine_size label in the same way as Prometheus does
See https://github.com/prometheus/prometheus/pull/11650
---
docs/CHANGELOG.md | 3 ++-
docs/sd_configs.md | 5 +++--
lib/promscrape/discovery/azure/azure.go | 3 +++
lib/promscrape/discovery/azure/azure_test.go | 17 +++++++++++------
lib/promscrape/discovery/azure/machine.go | 12 +++++++++---
5 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 4889b4a9b..db868abd9 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -21,9 +21,10 @@ The following tip changes can be tested by building VictoriaMetrics components f
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): embed fonts into binary instead of loading them from external sources. This allows using `vmui` in full from isolated networks without access to Internet. Thanks to @ScottKevill for [the pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3696).
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): add ability to switch between tenants by selecting the needed tenant in the drop-down list at the top right corner of the UI. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3673).
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): reduce memory usage when sending stale markers for targets, which expose big number of metrics. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3668) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3675) issues.
+* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add `__meta_kubernetes_pod_container_id` meta-label to the targets discovered via [kubernetes_sd_configs](https://docs.victoriametrics.com/sd_configs.html#kubernetes_sd_configs). This label has been added in Prometheus starting from `v2.42.0`. See [this feature request](https://github.com/prometheus/prometheus/issues/11843).
+* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add `__meta_azure_machine_size` meta-label to the targets discovered via [azure_sd_configs](https://docs.victoriametrics.com/sd_configs.html#azure_sd_configs). This label has been added in Prometheus starting from `v2.42.0`. See [this pull request](https://github.com/prometheus/prometheus/pull/11650).
* FEATURE: [vmauth](https://docs.victoriametrics.com/vmauth.html): allow limiting the number of concurrent requests sent to `vmauth` via `-maxConcurrentRequests` command-line flag. This allows controlling memory usage of `vmauth` and the resource usage of backends behind `vmauth`. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3346). Thanks to @dmitryk-dk for [the initial implementation](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3486).
* FEATURE: allow using VictoriaMetrics components behind proxies, which communicate with the backend via [proxy protocol](https://www.haproxy.org/download/2.3/doc/proxy-protocol.txt). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3335). For example, [vmauth](https://docs.victoriametrics.com/vmauth.html) accepts proxy protocol connections when it starts with `-httpListenAddr.useProxyProtocol` command-line flag.
-* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add `__meta_kubernetes_pod_container_id` meta-label to the targets discovered via [kubernetes_sd_configs](https://docs.victoriametrics.com/sd_configs.html#kubernetes_sd_configs). This label has been added in Prometheus starting from `v2.42.0`. See [this feature request](https://github.com/prometheus/prometheus/issues/11843).
* FEATURE: add `-internStringMaxLen` command-line flag, which can be used for fine-tuning RAM vs CPU usage in certain workloads. For example, if the stored time series contain long labels, then it may be useful reducing the `-internStringMaxLen` in order to reduce memory usage at the cost of increased CPU usage. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3692).
* BUGFIX: fix a bug, which could prevent background merges for the previous partitions until restart if the storage didn't have enough disk space for final deduplication and down-sampling.
diff --git a/docs/sd_configs.md b/docs/sd_configs.md
index a1f99ae35..a59b076f9 100644
--- a/docs/sd_configs.md
+++ b/docs/sd_configs.md
@@ -82,8 +82,9 @@ The following meta labels are available on discovered targets during [relabeling
* `__meta_azure_machine_private_ip`: the machine's private IP
* `__meta_azure_machine_public_ip`: the machine's public IP if it exists
* `__meta_azure_machine_resource_group`: the machine's resource group
-* `__meta_azure_machine_tag_`: each tag value of the machine
* `__meta_azure_machine_scale_set`: the name of the scale set which the vm is part of (this value is only set if you are using a scale set)
+* `__meta_azure_machine_size`: the machine size
+* `__meta_azure_machine_tag_`: each tag value of the machine
* `__meta_azure_subscription_id`: the subscription ID
* `__meta_azure_tenant_id`: the tenant ID
@@ -789,8 +790,8 @@ One of the following `role` types can be configured to discover targets:
* `__meta_kubernetes_pod_annotation_`: Each annotation from the pod object.
* `__meta_kubernetes_pod_annotationpresent_`: "true" for each annotation from the pod object.
* `__meta_kubernetes_pod_container_id`: ID of the container in the form `://`.
- * `__meta_kubernetes_pod_container_init`: "true" if the container is an InitContainer.
* `__meta_kubernetes_pod_container_image`: Container image the target address points to.
+ * `__meta_kubernetes_pod_container_init`: "true" if the container is an InitContainer.
* `__meta_kubernetes_pod_container_name`: Name of the container the target address points to.
* `__meta_kubernetes_pod_container_port_name`: Name of the container port.
* `__meta_kubernetes_pod_container_port_number`: Number of the container port.
diff --git a/lib/promscrape/discovery/azure/azure.go b/lib/promscrape/discovery/azure/azure.go
index 351b9c6fd..b1fe35fe9 100644
--- a/lib/promscrape/discovery/azure/azure.go
+++ b/lib/promscrape/discovery/azure/azure.go
@@ -97,6 +97,9 @@ func appendMachineLabels(vms []virtualMachine, port int, sdc *SDConfig) []*promu
if vm.scaleSet != "" {
m.Add("__meta_azure_machine_scale_set", vm.scaleSet)
}
+ if vm.Properties.HardwareProfile.VMSize != "" {
+ m.Add("__meta_azure_machine_size", vm.Properties.HardwareProfile.VMSize)
+ }
for k, v := range vm.Tags {
m.Add(discoveryutils.SanitizeLabelName("__meta_azure_machine_tag_"+k), v)
}
diff --git a/lib/promscrape/discovery/azure/azure_test.go b/lib/promscrape/discovery/azure/azure_test.go
index 7faa79bba..9b4d90a12 100644
--- a/lib/promscrape/discovery/azure/azure_test.go
+++ b/lib/promscrape/discovery/azure/azure_test.go
@@ -16,12 +16,16 @@ func TestAppendMachineLabels(t *testing.T) {
}
f("single vm", []virtualMachine{
{
- Name: "vm-1",
- ID: "id-2",
- Type: "Azure",
- Location: "eu-west-1",
- Properties: virtualMachineProperties{OsProfile: osProfile{ComputerName: "test-1"}, StorageProfile: storageProfile{OsDisk: osDisk{OsType: "Linux"}}},
- Tags: map[string]string{"key-1": "value-1"},
+ Name: "vm-1",
+ ID: "id-2",
+ Type: "Azure",
+ Location: "eu-west-1",
+ Properties: virtualMachineProperties{
+ OsProfile: osProfile{ComputerName: "test-1"},
+ StorageProfile: storageProfile{OsDisk: osDisk{OsType: "Linux"}},
+ HardwareProfile: hardwareProfile{VMSize: "big"},
+ },
+ Tags: map[string]string{"key-1": "value-1"},
ipAddresses: []vmIPAddress{
{privateIP: "10.10.10.1"},
},
@@ -36,6 +40,7 @@ func TestAppendMachineLabels(t *testing.T) {
"__meta_azure_machine_computer_name": "test-1",
"__meta_azure_machine_location": "eu-west-1",
"__meta_azure_machine_private_ip": "10.10.10.1",
+ "__meta_azure_machine_size": "big",
"__meta_azure_machine_tag_key_1": "value-1",
}),
})
diff --git a/lib/promscrape/discovery/azure/machine.go b/lib/promscrape/discovery/azure/machine.go
index e8e4f17a1..a9b86a8a7 100644
--- a/lib/promscrape/discovery/azure/machine.go
+++ b/lib/promscrape/discovery/azure/machine.go
@@ -29,9 +29,14 @@ type vmIPAddress struct {
}
type virtualMachineProperties struct {
- NetworkProfile networkProfile `json:"networkProfile,omitempty"`
- OsProfile osProfile `json:"osProfile,omitempty"`
- StorageProfile storageProfile `json:"storageProfile,omitempty"`
+ NetworkProfile networkProfile `json:"networkProfile,omitempty"`
+ OsProfile osProfile `json:"osProfile,omitempty"`
+ StorageProfile storageProfile `json:"storageProfile,omitempty"`
+ HardwareProfile hardwareProfile `json:"hardwareProfile,omitempty"`
+}
+
+type hardwareProfile struct {
+ VMSize string `json:"vmSize,omitempty"`
}
type storageProfile struct {
@@ -45,6 +50,7 @@ type osDisk struct {
type osProfile struct {
ComputerName string `json:"computerName,omitempty"`
}
+
type networkProfile struct {
// NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine.
NetworkInterfaces []networkInterfaceReference `json:"networkInterfaces,omitempty"`
From 1cbdcd391c823771adc3cf99ae22bfabb990258c Mon Sep 17 00:00:00 2001
From: Roman Khavronenko
Date: Mon, 30 Jan 2023 16:28:33 +0100
Subject: [PATCH 13/26] docs: mention `-vmalert.proxyURL` in vmalert docs
(#3730)
Signed-off-by: hagen1778
---
app/vmalert/README.md | 7 +++++++
docs/vmalert.md | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/app/vmalert/README.md b/app/vmalert/README.md
index cfd4bd156..ecb35d875 100644
--- a/app/vmalert/README.md
+++ b/app/vmalert/README.md
@@ -9,6 +9,13 @@ protocol and require `-remoteWrite.url` to be configured.
Vmalert is heavily inspired by [Prometheus](https://prometheus.io/docs/alerting/latest/overview/)
implementation and aims to be compatible with its syntax.
+A [single-node](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#vmalert)
+or [cluster version](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#vmalert)
+of VictoriaMetrics are capable of proxying requests to vmalert via `-vmalert.proxyURL` command-line flag.
+Use this feature for the following cases:
+* for proxying requests from [Grafana Alerting UI](https://grafana.com/docs/grafana/latest/alerting/);
+* for accessing vmalert's UI through VictoriaMetrics Web interface.
+
## Features
* Integration with [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) TSDB;
diff --git a/docs/vmalert.md b/docs/vmalert.md
index b47b30d5f..eaac75265 100644
--- a/docs/vmalert.md
+++ b/docs/vmalert.md
@@ -13,6 +13,13 @@ protocol and require `-remoteWrite.url` to be configured.
Vmalert is heavily inspired by [Prometheus](https://prometheus.io/docs/alerting/latest/overview/)
implementation and aims to be compatible with its syntax.
+A [single-node](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#vmalert)
+or [cluster version](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#vmalert)
+of VictoriaMetrics are capable of proxying requests to vmalert via `-vmalert.proxyURL` command-line flag.
+Use this feature for the following cases:
+* for proxying requests from [Grafana Alerting UI](https://grafana.com/docs/grafana/latest/alerting/);
+* for accessing vmalert's UI through VictoriaMetrics Web interface.
+
## Features
* Integration with [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) TSDB;
From ac8bc77688be47113620bf406dfb8009f2ffdfe6 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Tue, 31 Jan 2023 10:55:31 -0800
Subject: [PATCH 14/26] lib/bytesutil/internstring.go: increase the limit on
the maximum string lengths, which can be interned
The limit has been increased from 300 bytes to 500 bytes according to the collected production stats.
This allows reducing CPU usage without significant increase of RAM usage in most practical cases.
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3692
---
lib/bytesutil/internstring.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bytesutil/internstring.go b/lib/bytesutil/internstring.go
index cfb652e5e..600758c8a 100644
--- a/lib/bytesutil/internstring.go
+++ b/lib/bytesutil/internstring.go
@@ -9,7 +9,7 @@ import (
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
)
-var internStringMaxLen = flag.Int("internStringMaxLen", 300, "The maximum length for strings to intern. Lower limit may save memory at the cost of higher CPU usage. "+
+var internStringMaxLen = flag.Int("internStringMaxLen", 500, "The maximum length for strings to intern. Lower limit may save memory at the cost of higher CPU usage. "+
"See https://en.wikipedia.org/wiki/String_interning")
// InternBytes interns b as a string
From 080a3e2396031cd40f3a1801ff7f50a76f20b167 Mon Sep 17 00:00:00 2001
From: Aliaksandr Valialkin
Date: Tue, 31 Jan 2023 11:03:20 -0800
Subject: [PATCH 15/26] vendor: `make vendor-update`
---
go.mod | 18 +-
go.sum | 36 +-
.../github.com/aws/aws-sdk-go/aws/version.go | 2 +-
.../github.com/go-logfmt/logfmt/CHANGELOG.md | 48 +-
vendor/github.com/go-logfmt/logfmt/README.md | 30 +-
vendor/github.com/go-logfmt/logfmt/decode.go | 17 +
vendor/github.com/urfave/cli/v2/README.md | 8 +-
vendor/github.com/urfave/cli/v2/app.go | 33 +-
vendor/github.com/urfave/cli/v2/category.go | 17 +-
vendor/github.com/urfave/cli/v2/command.go | 4 +-
.../github.com/urfave/cli/v2/flag-spec.yaml | 12 +
vendor/github.com/urfave/cli/v2/flag.go | 31 +-
.../urfave/cli/v2/flag_float64_slice.go | 14 +-
.../urfave/cli/v2/flag_int64_slice.go | 14 +-
.../urfave/cli/v2/flag_int_slice.go | 14 +-
.../urfave/cli/v2/flag_string_slice.go | 14 +-
.../urfave/cli/v2/flag_uint64_slice.go | 14 +-
.../urfave/cli/v2/flag_uint_slice.go | 14 +-
.../urfave/cli/v2/godoc-current.txt | 24 +
.../urfave/cli/v2/zz_generated.flags.go | 12 +
.../net/http/otelhttp/config.go | 9 +
.../net/http/otelhttp/handler.go | 48 +-
.../net/http/otelhttp/transport.go | 8 +-
.../net/http/otelhttp/version.go | 2 +-
vendor/go.opentelemetry.io/otel/.lycheeignore | 1 +
vendor/go.opentelemetry.io/otel/CHANGELOG.md | 138 ++-
vendor/go.opentelemetry.io/otel/Makefile | 10 +-
vendor/go.opentelemetry.io/otel/RELEASING.md | 11 +-
vendor/go.opentelemetry.io/otel/handler.go | 25 +-
.../otel/internal/global/internal_logging.go | 30 +-
.../otel/metric/instrument/asyncfloat64.go | 131 +++
.../instrument/asyncfloat64/asyncfloat64.go | 80 --
.../otel/metric/instrument/asyncint64.go | 131 +++
.../instrument/asyncint64/asyncint64.go | 80 --
.../otel/metric/instrument/config.go | 69 --
.../otel/metric/instrument/instrument.go | 60 ++
.../otel/metric/instrument/syncfloat64.go | 86 ++
.../instrument/syncfloat64/syncfloat64.go | 64 --
.../instrument/{syncint64 => }/syncint64.go | 68 +-
.../metric/internal/global/instruments.go | 213 ++--
.../otel/metric/internal/global/meter.go | 335 +++---
.../go.opentelemetry.io/otel/metric/meter.go | 116 ++-
.../go.opentelemetry.io/otel/metric/noop.go | 127 ++-
.../otel/semconv/internal/http.go | 336 ------
.../otel/semconv/internal/v2/http.go | 405 ++++++++
.../otel/semconv/internal/v2/net.go | 324 ++++++
.../otel/semconv/v1.12.0/http.go | 114 --
.../otel/semconv/{v1.12.0 => v1.17.0}/doc.go | 4 +-
.../semconv/{v1.12.0 => v1.17.0}/exception.go | 2 +-
.../otel/semconv/v1.17.0/http.go | 21 +
.../otel/semconv/v1.17.0/httpconv/http.go | 150 +++
.../semconv/{v1.12.0 => v1.17.0}/resource.go | 264 +++--
.../semconv/{v1.12.0 => v1.17.0}/schema.go | 4 +-
.../semconv/{v1.12.0 => v1.17.0}/trace.go | 972 +++++++++++-------
vendor/go.opentelemetry.io/otel/version.go | 2 +-
vendor/go.opentelemetry.io/otel/versions.yaml | 4 +-
.../google.golang.org/api/internal/version.go | 2 +-
vendor/modules.txt | 27 +-
58 files changed, 3074 insertions(+), 1775 deletions(-)
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64/asyncfloat64.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64/asyncint64.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/config.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64/syncfloat64.go
rename vendor/go.opentelemetry.io/otel/metric/instrument/{syncint64 => }/syncint64.go (50%)
delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/internal/http.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go
delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
rename vendor/go.opentelemetry.io/otel/semconv/{v1.12.0 => v1.17.0}/doc.go (92%)
rename vendor/go.opentelemetry.io/otel/semconv/{v1.12.0 => v1.17.0}/exception.go (99%)
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go
rename vendor/go.opentelemetry.io/otel/semconv/{v1.12.0 => v1.17.0}/resource.go (84%)
rename vendor/go.opentelemetry.io/otel/semconv/{v1.12.0 => v1.17.0}/schema.go (93%)
rename vendor/go.opentelemetry.io/otel/semconv/{v1.12.0 => v1.17.0}/trace.go (71%)
diff --git a/go.mod b/go.mod
index 28d3fa5a0..b612a6239 100644
--- a/go.mod
+++ b/go.mod
@@ -25,7 +25,7 @@ require (
github.com/influxdata/influxdb v1.11.0
github.com/klauspost/compress v1.15.15
github.com/prometheus/prometheus v0.41.0
- github.com/urfave/cli/v2 v2.24.1
+ github.com/urfave/cli/v2 v2.24.2
github.com/valyala/fastjson v1.6.4
github.com/valyala/fastrand v1.1.0
github.com/valyala/fasttemplate v1.2.2
@@ -35,7 +35,7 @@ require (
golang.org/x/net v0.5.0
golang.org/x/oauth2 v0.4.0
golang.org/x/sys v0.4.0
- google.golang.org/api v0.108.0
+ google.golang.org/api v0.109.0
gopkg.in/yaml.v2 v2.4.0
)
@@ -47,7 +47,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
- github.com/aws/aws-sdk-go v1.44.189 // indirect
+ github.com/aws/aws-sdk-go v1.44.190 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.10 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect
@@ -70,7 +70,7 @@ require (
github.com/fatih/color v1.14.1 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/go-kit/log v0.2.1 // indirect
- github.com/go-logfmt/logfmt v0.5.1 // indirect
+ github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -100,13 +100,13 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.opencensus.io v0.24.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 // indirect
- go.opentelemetry.io/otel v1.11.2 // indirect
- go.opentelemetry.io/otel/metric v0.34.0 // indirect
- go.opentelemetry.io/otel/trace v1.11.2 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.38.0 // indirect
+ go.opentelemetry.io/otel v1.12.0 // indirect
+ go.opentelemetry.io/otel/metric v0.35.0 // indirect
+ go.opentelemetry.io/otel/trace v1.12.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/goleak v1.2.0 // indirect
- golang.org/x/exp v0.0.0-20230127193734-31bee513bff7 // indirect
+ golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/time v0.3.0 // indirect
diff --git a/go.sum b/go.sum
index e8bd4d261..a1d984912 100644
--- a/go.sum
+++ b/go.sum
@@ -87,8 +87,8 @@ github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu
github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo=
github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
-github.com/aws/aws-sdk-go v1.44.189 h1:9PBrjndH1uL5AN8818qI3duhQ4hgkMuLvqkJlg9MRyk=
-github.com/aws/aws-sdk-go v1.44.189/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.44.190 h1:QC+Pf/Ooj7Waf2obOPZbIQOqr00hy4h54j3ZK9mvHcc=
+github.com/aws/aws-sdk-go v1.44.190/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.17.3 h1:shN7NlnVzvDUgPQ+1rLMSxY8OWRNDRYtiqe0p/PgrhY=
github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs=
@@ -182,8 +182,8 @@ github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBj
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
-github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
-github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
+github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
+github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -419,8 +419,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU=
-github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
+github.com/urfave/cli/v2 v2.24.2 h1:q1VA+ofZ8SWfEKB9xXHUD4QZaeI9e+ItEqSbfH2JBXk=
+github.com/urfave/cli/v2 v2.24.2/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus=
@@ -452,14 +452,14 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 h1:yt2NKzK7Vyo6h0+X8BA4FpreZQTlVEIarnsBP/H5mzs=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0/go.mod h1:+ARmXlUlc51J7sZeCBkBJNdHGySrdOzgzxp6VWRWM1U=
-go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0=
-go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI=
-go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8=
-go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8=
-go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0=
-go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.38.0 h1:rTxmym+VN9f6ajzNtITVgyvZrNbpLt3NHr3suLLHLEQ=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.38.0/go.mod h1:w6xNm+kC506KNs5cknSHal6dtdRnc4uema0uN9GSQc0=
+go.opentelemetry.io/otel v1.12.0 h1:IgfC7kqQrRccIKuB7Cl+SRUmsKbEwSGPr0Eu+/ht1SQ=
+go.opentelemetry.io/otel v1.12.0/go.mod h1:geaoz0L0r1BEOR81k7/n9W4TCXYCJ7bPO7K374jQHG0=
+go.opentelemetry.io/otel/metric v0.35.0 h1:aPT5jk/w7F9zW51L7WgRqNKDElBdyRLGuBtI5MX34e8=
+go.opentelemetry.io/otel/metric v0.35.0/go.mod h1:qAcbhaTRFU6uG8QM7dDo7XvFsWcugziq/5YI065TokQ=
+go.opentelemetry.io/otel/trace v1.12.0 h1:p28in++7Kd0r2d8gSt931O57fdjUyWxkVbESuILAeUc=
+go.opentelemetry.io/otel/trace v1.12.0/go.mod h1:pHlgBynn6s25qJ2szD+Bv+iwKJttjHSI3lUAyf0GNuQ=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
@@ -483,8 +483,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20230127193734-31bee513bff7 h1:pXR8mGh4q8ooBT7HXruL4Xa2IxoL8XZ6lOgXY/0Ryg8=
-golang.org/x/exp v0.0.0-20230127193734-31bee513bff7/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
+golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 h1:BEABXpNXLEz0WxtA+6CQIz2xkg80e+1zrhWyMcq8VzE=
+golang.org/x/exp v0.0.0-20230131160201-f062dba9d201/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -698,8 +698,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
-google.golang.org/api v0.108.0 h1:WVBc/faN0DkKtR43Q/7+tPny9ZoLZdIiAyG5Q9vFClg=
-google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY=
+google.golang.org/api v0.109.0 h1:sW9hgHyX497PP5//NUM7nqfV8D0iDfBApqq7sOh1XR8=
+google.golang.org/api v0.109.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go
index 9e8856ba5..261a071a6 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/version.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "1.44.189"
+const SDKVersion = "1.44.190"
diff --git a/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md b/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md
index 1a9a27bcf..8f349c4b8 100644
--- a/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md
+++ b/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md
@@ -1,48 +1,82 @@
# Changelog
+
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## [0.5.0] - 2020-01-03
+## [0.6.0] - 2023-01-30
+
+[0.6.0]: https://github.com/go-logfmt/logfmt/compare/v0.5.1...v0.6.0
+
+### Added
+
+- NewDecoderSize by [@alexanderjophus]
+
+## [0.5.1] - 2021-08-18
+
+[0.5.1]: https://github.com/go-logfmt/logfmt/compare/v0.5.0...v0.5.1
### Changed
+
+- Update the `go.mod` file for Go 1.17 as described in the [Go 1.17 release
+ notes](https://golang.org/doc/go1.17#go-command)
+
+## [0.5.0] - 2020-01-03
+
+[0.5.0]: https://github.com/go-logfmt/logfmt/compare/v0.4.0...v0.5.0
+
+### Changed
+
- Remove the dependency on github.com/kr/logfmt by [@ChrisHines]
- Move fuzz code to github.com/go-logfmt/fuzzlogfmt by [@ChrisHines]
## [0.4.0] - 2018-11-21
+[0.4.0]: https://github.com/go-logfmt/logfmt/compare/v0.3.0...v0.4.0
+
### Added
+
- Go module support by [@ChrisHines]
- CHANGELOG by [@ChrisHines]
### Changed
+
- Drop invalid runes from keys instead of returning ErrInvalidKey by [@ChrisHines]
- On panic while printing, attempt to print panic value by [@bboreham]
## [0.3.0] - 2016-11-15
+
+[0.3.0]: https://github.com/go-logfmt/logfmt/compare/v0.2.0...v0.3.0
+
### Added
+
- Pool buffers for quoted strings and byte slices by [@nussjustin]
+
### Fixed
+
- Fuzz fix, quote invalid UTF-8 values by [@judwhite]
## [0.2.0] - 2016-05-08
+
+[0.2.0]: https://github.com/go-logfmt/logfmt/compare/v0.1.0...v0.2.0
+
### Added
+
- Encoder.EncodeKeyvals by [@ChrisHines]
## [0.1.0] - 2016-03-28
+
+[0.1.0]: https://github.com/go-logfmt/logfmt/commits/v0.1.0
+
### Added
+
- Encoder by [@ChrisHines]
- Decoder by [@ChrisHines]
- MarshalKeyvals by [@ChrisHines]
-[0.5.0]: https://github.com/go-logfmt/logfmt/compare/v0.4.0...v0.5.0
-[0.4.0]: https://github.com/go-logfmt/logfmt/compare/v0.3.0...v0.4.0
-[0.3.0]: https://github.com/go-logfmt/logfmt/compare/v0.2.0...v0.3.0
-[0.2.0]: https://github.com/go-logfmt/logfmt/compare/v0.1.0...v0.2.0
-[0.1.0]: https://github.com/go-logfmt/logfmt/commits/v0.1.0
-
[@ChrisHines]: https://github.com/ChrisHines
[@bboreham]: https://github.com/bboreham
[@judwhite]: https://github.com/judwhite
[@nussjustin]: https://github.com/nussjustin
+[@alexanderjophus]: https://github.com/alexanderjophus
diff --git a/vendor/github.com/go-logfmt/logfmt/README.md b/vendor/github.com/go-logfmt/logfmt/README.md
index 8e48fcd3a..71c57944e 100644
--- a/vendor/github.com/go-logfmt/logfmt/README.md
+++ b/vendor/github.com/go-logfmt/logfmt/README.md
@@ -1,20 +1,25 @@
+# logfmt
+
[![Go Reference](https://pkg.go.dev/badge/github.com/go-logfmt/logfmt.svg)](https://pkg.go.dev/github.com/go-logfmt/logfmt)
[![Go Report Card](https://goreportcard.com/badge/go-logfmt/logfmt)](https://goreportcard.com/report/go-logfmt/logfmt)
[![Github Actions](https://github.com/go-logfmt/logfmt/actions/workflows/test.yml/badge.svg)](https://github.com/go-logfmt/logfmt/actions/workflows/test.yml)
-[![Coverage Status](https://coveralls.io/repos/github/go-logfmt/logfmt/badge.svg?branch=master)](https://coveralls.io/github/go-logfmt/logfmt?branch=master)
-
-# logfmt
+[![Coverage Status](https://coveralls.io/repos/github/go-logfmt/logfmt/badge.svg?branch=master)](https://coveralls.io/github/go-logfmt/logfmt?branch=main)
Package logfmt implements utilities to marshal and unmarshal data in the [logfmt
-format](https://brandur.org/logfmt). It provides an API similar to
-[encoding/json](http://golang.org/pkg/encoding/json/) and
-[encoding/xml](http://golang.org/pkg/encoding/xml/).
+format][fmt]. It provides an API similar to [encoding/json][json] and
+[encoding/xml][xml].
+
+[fmt]: https://brandur.org/logfmt
+[json]: https://pkg.go.dev/encoding/json
+[xml]: https://pkg.go.dev/encoding/xml
The logfmt format was first documented by Brandur Leach in [this
-article](https://brandur.org/logfmt). The format has not been formally
-standardized. The most authoritative public specification to date has been the
-documentation of a Go Language [package](http://godoc.org/github.com/kr/logfmt)
-written by Blake Mizerany and Keith Rarick.
+article][origin]. The format has not been formally standardized. The most
+authoritative public specification to date has been the documentation of a Go
+Language [package][parser] written by Blake Mizerany and Keith Rarick.
+
+[origin]: https://brandur.org/logfmt
+[parser]: https://pkg.go.dev/github.com/kr/logfmt
## Goals
@@ -30,4 +35,7 @@ standard as a goal.
## Versioning
-Package logfmt publishes releases via [semver](http://semver.org/) compatible Git tags prefixed with a single 'v'.
+This project publishes releases according to the Go language guidelines for
+[developing and publishing modules][pub].
+
+[pub]: https://go.dev/doc/modules/developing
diff --git a/vendor/github.com/go-logfmt/logfmt/decode.go b/vendor/github.com/go-logfmt/logfmt/decode.go
index 2013708e4..a1c22dcbd 100644
--- a/vendor/github.com/go-logfmt/logfmt/decode.go
+++ b/vendor/github.com/go-logfmt/logfmt/decode.go
@@ -29,6 +29,23 @@ func NewDecoder(r io.Reader) *Decoder {
return dec
}
+// NewDecoderSize returns a new decoder that reads from r.
+//
+// The decoder introduces its own buffering and may read data from r beyond
+// the logfmt records requested.
+// The size argument specifies the size of the initial buffer that the
+// Decoder will use to read records from r.
+// If a log line is longer than the size argument, the Decoder will return
+// a bufio.ErrTooLong error.
+func NewDecoderSize(r io.Reader, size int) *Decoder {
+ scanner := bufio.NewScanner(r)
+ scanner.Buffer(make([]byte, 0, size), size)
+ dec := &Decoder{
+ s: scanner,
+ }
+ return dec
+}
+
// ScanRecord advances the Decoder to the next record, which can then be
// parsed with the ScanKeyval method. It returns false when decoding stops,
// either by reaching the end of the input or an error. After ScanRecord
diff --git a/vendor/github.com/urfave/cli/v2/README.md b/vendor/github.com/urfave/cli/v2/README.md
index eaed35630..9080aee41 100644
--- a/vendor/github.com/urfave/cli/v2/README.md
+++ b/vendor/github.com/urfave/cli/v2/README.md
@@ -1,9 +1,9 @@
# cli
-[![GoDoc](https://godoc.org/github.com/urfave/cli?status.svg)](https://pkg.go.dev/github.com/urfave/cli/v2)
-[![codebeat](https://codebeat.co/badges/0a8f30aa-f975-404b-b878-5fab3ae1cc5f)](https://codebeat.co/projects/github-com-urfave-cli)
-[![Go Report Card](https://goreportcard.com/badge/urfave/cli)](https://goreportcard.com/report/urfave/cli)
-[![codecov](https://codecov.io/gh/urfave/cli/branch/main/graph/badge.svg)](https://codecov.io/gh/urfave/cli)
+[![Run Tests](https://github.com/urfave/cli/actions/workflows/cli.yml/badge.svg?branch=v2-maint)](https://github.com/urfave/cli/actions/workflows/cli.yml)
+[![Go Reference](https://pkg.go.dev/badge/github.com/urfave/cli/v2.svg)](https://pkg.go.dev/github.com/urfave/cli/v2)
+[![Go Report Card](https://goreportcard.com/badge/github.com/urfave/cli/v2)](https://goreportcard.com/report/github.com/urfave/cli/v2)
+[![codecov](https://codecov.io/gh/urfave/cli/branch/v2-maint/graph/badge.svg?token=t9YGWLh05g)](https://app.codecov.io/gh/urfave/cli/tree/v2-maint)
cli is a simple, fast, and fun package for building command line apps in Go. The
goal is to enable developers to write fast and distributable command line
diff --git a/vendor/github.com/urfave/cli/v2/app.go b/vendor/github.com/urfave/cli/v2/app.go
index 10198f433..4b6675a2d 100644
--- a/vendor/github.com/urfave/cli/v2/app.go
+++ b/vendor/github.com/urfave/cli/v2/app.go
@@ -121,7 +121,8 @@ type App struct {
// Treat all flags as normal arguments if true
SkipFlagParsing bool
- didSetup bool
+ didSetup bool
+ separator separatorSpec
rootCommand *Command
}
@@ -216,6 +217,16 @@ func (a *App) Setup() {
})
}
+ if len(a.SliceFlagSeparator) != 0 {
+ a.separator.customized = true
+ a.separator.sep = a.SliceFlagSeparator
+ }
+
+ if a.DisableSliceFlagSeparator {
+ a.separator.customized = true
+ a.separator.disabled = true
+ }
+
var newCommands []*Command
for _, c := range a.Commands {
@@ -223,8 +234,8 @@ func (a *App) Setup() {
if c.HelpName != "" {
cname = c.HelpName
}
+ c.separator = a.separator
c.HelpName = fmt.Sprintf("%s %s", a.HelpName, cname)
-
c.flagCategories = newFlagCategoriesFromFlags(c.Flags)
newCommands = append(newCommands, c)
}
@@ -250,24 +261,11 @@ func (a *App) Setup() {
}
sort.Sort(a.categories.(*commandCategories))
- a.flagCategories = newFlagCategories()
- for _, fl := range a.Flags {
- if cf, ok := fl.(CategorizableFlag); ok {
- if cf.GetCategory() != "" {
- a.flagCategories.AddFlag(cf.GetCategory(), cf)
- }
- }
- }
+ a.flagCategories = newFlagCategoriesFromFlags(a.Flags)
if a.Metadata == nil {
a.Metadata = make(map[string]interface{})
}
-
- if len(a.SliceFlagSeparator) != 0 {
- defaultSliceFlagSeparator = a.SliceFlagSeparator
- }
-
- disableSliceFlagSeparator = a.DisableSliceFlagSeparator
}
func (a *App) newRootCommand() *Command {
@@ -293,11 +291,12 @@ func (a *App) newRootCommand() *Command {
categories: a.categories,
SkipFlagParsing: a.SkipFlagParsing,
isRoot: true,
+ separator: a.separator,
}
}
func (a *App) newFlagSet() (*flag.FlagSet, error) {
- return flagSet(a.Name, a.Flags)
+ return flagSet(a.Name, a.Flags, a.separator)
}
func (a *App) useShortOptionHandling() bool {
diff --git a/vendor/github.com/urfave/cli/v2/category.go b/vendor/github.com/urfave/cli/v2/category.go
index 7aca0c768..ccc043c25 100644
--- a/vendor/github.com/urfave/cli/v2/category.go
+++ b/vendor/github.com/urfave/cli/v2/category.go
@@ -100,10 +100,23 @@ func newFlagCategories() FlagCategories {
func newFlagCategoriesFromFlags(fs []Flag) FlagCategories {
fc := newFlagCategories()
+
+ var categorized bool
for _, fl := range fs {
if cf, ok := fl.(CategorizableFlag); ok {
- if cf.GetCategory() != "" {
- fc.AddFlag(cf.GetCategory(), cf)
+ if cat := cf.GetCategory(); cat != "" {
+ fc.AddFlag(cat, cf)
+ categorized = true
+ }
+ }
+ }
+
+ if categorized == true {
+ for _, fl := range fs {
+ if cf, ok := fl.(CategorizableFlag); ok {
+ if cf.GetCategory() == "" {
+ fc.AddFlag("", fl)
+ }
}
}
}
diff --git a/vendor/github.com/urfave/cli/v2/command.go b/vendor/github.com/urfave/cli/v2/command.go
index da9cf5302..f978b4a43 100644
--- a/vendor/github.com/urfave/cli/v2/command.go
+++ b/vendor/github.com/urfave/cli/v2/command.go
@@ -69,6 +69,8 @@ type Command struct {
// if this is a root "special" command
isRoot bool
+
+ separator separatorSpec
}
type Commands []*Command
@@ -275,7 +277,7 @@ func (c *Command) Run(cCtx *Context, arguments ...string) (err error) {
}
func (c *Command) newFlagSet() (*flag.FlagSet, error) {
- return flagSet(c.Name, c.Flags)
+ return flagSet(c.Name, c.Flags, c.separator)
}
func (c *Command) useShortOptionHandling() bool {
diff --git a/vendor/github.com/urfave/cli/v2/flag-spec.yaml b/vendor/github.com/urfave/cli/v2/flag-spec.yaml
index cfe47df06..ed4db985d 100644
--- a/vendor/github.com/urfave/cli/v2/flag-spec.yaml
+++ b/vendor/github.com/urfave/cli/v2/flag-spec.yaml
@@ -20,6 +20,8 @@ flag_types:
skip_interfaces:
- fmt.Stringer
struct_fields:
+ - name: separator
+ type: separatorSpec
- name: Action
type: "func(*Context, []float64) error"
int:
@@ -33,6 +35,8 @@ flag_types:
skip_interfaces:
- fmt.Stringer
struct_fields:
+ - name: separator
+ type: separatorSpec
- name: Action
type: "func(*Context, []int) error"
int64:
@@ -46,6 +50,8 @@ flag_types:
skip_interfaces:
- fmt.Stringer
struct_fields:
+ - name: separator
+ type: separatorSpec
- name: Action
type: "func(*Context, []int64) error"
uint:
@@ -59,6 +65,8 @@ flag_types:
skip_interfaces:
- fmt.Stringer
struct_fields:
+ - name: separator
+ type: separatorSpec
- name: Action
type: "func(*Context, []uint) error"
uint64:
@@ -72,6 +80,8 @@ flag_types:
skip_interfaces:
- fmt.Stringer
struct_fields:
+ - name: separator
+ type: separatorSpec
- name: Action
type: "func(*Context, []uint64) error"
string:
@@ -85,6 +95,8 @@ flag_types:
skip_interfaces:
- fmt.Stringer
struct_fields:
+ - name: separator
+ type: separatorSpec
- name: TakesFile
type: bool
- name: Action
diff --git a/vendor/github.com/urfave/cli/v2/flag.go b/vendor/github.com/urfave/cli/v2/flag.go
index 5260f7f9e..fc3744ec8 100644
--- a/vendor/github.com/urfave/cli/v2/flag.go
+++ b/vendor/github.com/urfave/cli/v2/flag.go
@@ -15,7 +15,7 @@ import (
const defaultPlaceholder = "value"
-var (
+const (
defaultSliceFlagSeparator = ","
disableSliceFlagSeparator = false
)
@@ -167,10 +167,13 @@ type Countable interface {
Count() int
}
-func flagSet(name string, flags []Flag) (*flag.FlagSet, error) {
+func flagSet(name string, flags []Flag, spec separatorSpec) (*flag.FlagSet, error) {
set := flag.NewFlagSet(name, flag.ContinueOnError)
for _, f := range flags {
+ if c, ok := f.(customizedSeparator); ok {
+ c.WithSeparatorSpec(spec)
+ }
if err := f.Apply(set); err != nil {
return nil, err
}
@@ -389,10 +392,28 @@ func flagFromEnvOrFile(envVars []string, filePath string) (value string, fromWhe
return "", "", false
}
-func flagSplitMultiValues(val string) []string {
- if disableSliceFlagSeparator {
+type customizedSeparator interface {
+ WithSeparatorSpec(separatorSpec)
+}
+
+type separatorSpec struct {
+ sep string
+ disabled bool
+ customized bool
+}
+
+func (s separatorSpec) flagSplitMultiValues(val string) []string {
+ var (
+ disabled bool = s.disabled
+ sep string = s.sep
+ )
+ if !s.customized {
+ disabled = disableSliceFlagSeparator
+ sep = defaultSliceFlagSeparator
+ }
+ if disabled {
return []string{val}
}
- return strings.Split(val, defaultSliceFlagSeparator)
+ return strings.Split(val, sep)
}
diff --git a/vendor/github.com/urfave/cli/v2/flag_float64_slice.go b/vendor/github.com/urfave/cli/v2/flag_float64_slice.go
index 413aa50e9..0bc4612c8 100644
--- a/vendor/github.com/urfave/cli/v2/flag_float64_slice.go
+++ b/vendor/github.com/urfave/cli/v2/flag_float64_slice.go
@@ -11,6 +11,7 @@ import (
// Float64Slice wraps []float64 to satisfy flag.Value
type Float64Slice struct {
slice []float64
+ separator separatorSpec
hasBeenSet bool
}
@@ -29,6 +30,10 @@ func (f *Float64Slice) clone() *Float64Slice {
return n
}
+func (f *Float64Slice) WithSeparatorSpec(spec separatorSpec) {
+ f.separator = spec
+}
+
// Set parses the value into a float64 and appends it to the list of values
func (f *Float64Slice) Set(value string) error {
if !f.hasBeenSet {
@@ -43,7 +48,7 @@ func (f *Float64Slice) Set(value string) error {
return nil
}
- for _, s := range flagSplitMultiValues(value) {
+ for _, s := range f.separator.flagSplitMultiValues(value) {
tmp, err := strconv.ParseFloat(strings.TrimSpace(s), 64)
if err != nil {
return err
@@ -148,11 +153,12 @@ func (f *Float64SliceFlag) Apply(set *flag.FlagSet) error {
setValue = f.Value.clone()
default:
setValue = new(Float64Slice)
+ setValue.WithSeparatorSpec(f.separator)
}
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
if val != "" {
- for _, s := range flagSplitMultiValues(val) {
+ for _, s := range f.separator.flagSplitMultiValues(val) {
if err := setValue.Set(strings.TrimSpace(s)); err != nil {
return fmt.Errorf("could not parse %q as float64 slice value from %s for flag %s: %s", val, source, f.Name, err)
}
@@ -172,6 +178,10 @@ func (f *Float64SliceFlag) Apply(set *flag.FlagSet) error {
return nil
}
+func (f *Float64SliceFlag) WithSeparatorSpec(spec separatorSpec) {
+ f.separator = spec
+}
+
// Get returns the flag’s value in the given Context.
func (f *Float64SliceFlag) Get(ctx *Context) []float64 {
return ctx.Float64Slice(f.Name)
diff --git a/vendor/github.com/urfave/cli/v2/flag_int64_slice.go b/vendor/github.com/urfave/cli/v2/flag_int64_slice.go
index c45c43d3a..d45c2dd44 100644
--- a/vendor/github.com/urfave/cli/v2/flag_int64_slice.go
+++ b/vendor/github.com/urfave/cli/v2/flag_int64_slice.go
@@ -11,6 +11,7 @@ import (
// Int64Slice wraps []int64 to satisfy flag.Value
type Int64Slice struct {
slice []int64
+ separator separatorSpec
hasBeenSet bool
}
@@ -29,6 +30,10 @@ func (i *Int64Slice) clone() *Int64Slice {
return n
}
+func (i *Int64Slice) WithSeparatorSpec(spec separatorSpec) {
+ i.separator = spec
+}
+
// Set parses the value into an integer and appends it to the list of values
func (i *Int64Slice) Set(value string) error {
if !i.hasBeenSet {
@@ -43,7 +48,7 @@ func (i *Int64Slice) Set(value string) error {
return nil
}
- for _, s := range flagSplitMultiValues(value) {
+ for _, s := range i.separator.flagSplitMultiValues(value) {
tmp, err := strconv.ParseInt(strings.TrimSpace(s), 0, 64)
if err != nil {
return err
@@ -149,10 +154,11 @@ func (f *Int64SliceFlag) Apply(set *flag.FlagSet) error {
setValue = f.Value.clone()
default:
setValue = new(Int64Slice)
+ setValue.WithSeparatorSpec(f.separator)
}
if val, source, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok && val != "" {
- for _, s := range flagSplitMultiValues(val) {
+ for _, s := range f.separator.flagSplitMultiValues(val) {
if err := setValue.Set(strings.TrimSpace(s)); err != nil {
return fmt.Errorf("could not parse %q as int64 slice value from %s for flag %s: %s", val, source, f.Name, err)
}
@@ -171,6 +177,10 @@ func (f *Int64SliceFlag) Apply(set *flag.FlagSet) error {
return nil
}
+func (f *Int64SliceFlag) WithSeparatorSpec(spec separatorSpec) {
+ f.separator = spec
+}
+
// Get returns the flag’s value in the given Context.
func (f *Int64SliceFlag) Get(ctx *Context) []int64 {
return ctx.Int64Slice(f.Name)
diff --git a/vendor/github.com/urfave/cli/v2/flag_int_slice.go b/vendor/github.com/urfave/cli/v2/flag_int_slice.go
index d4006e594..da9c09bc7 100644
--- a/vendor/github.com/urfave/cli/v2/flag_int_slice.go
+++ b/vendor/github.com/urfave/cli/v2/flag_int_slice.go
@@ -11,6 +11,7 @@ import (
// IntSlice wraps []int to satisfy flag.Value
type IntSlice struct {
slice []int
+ separator separatorSpec
hasBeenSet bool
}
@@ -40,6 +41,10 @@ func (i *IntSlice) SetInt(value int) {
i.slice = append(i.slice, value)
}
+func (i *IntSlice) WithSeparatorSpec(spec separatorSpec) {
+ i.separator = spec
+}
+
// Set parses the value into an integer and appends it to the list of values
func (i *IntSlice) Set(value string) error {
if !i.hasBeenSet {
@@ -54,7 +59,7 @@ func (i *IntSlice) Set(value string) error {
return nil
}
- for _, s := range flagSplitMultiValues(value) {
+ for _, s := range i.separator.flagSplitMultiValues(value) {
tmp, err := strconv.ParseInt(strings.TrimSpace(s), 0, 64)
if err != nil {
return err
@@ -160,10 +165,11 @@ func (f *IntSliceFlag) Apply(set *flag.FlagSet) error {
setValue = f.Value.clone()
default:
setValue = new(IntSlice)
+ setValue.WithSeparatorSpec(f.separator)
}
if val, source, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok && val != "" {
- for _, s := range flagSplitMultiValues(val) {
+ for _, s := range f.separator.flagSplitMultiValues(val) {
if err := setValue.Set(strings.TrimSpace(s)); err != nil {
return fmt.Errorf("could not parse %q as int slice value from %s for flag %s: %s", val, source, f.Name, err)
}
@@ -182,6 +188,10 @@ func (f *IntSliceFlag) Apply(set *flag.FlagSet) error {
return nil
}
+func (f *IntSliceFlag) WithSeparatorSpec(spec separatorSpec) {
+ f.separator = spec
+}
+
// Get returns the flag’s value in the given Context.
func (f *IntSliceFlag) Get(ctx *Context) []int {
return ctx.IntSlice(f.Name)
diff --git a/vendor/github.com/urfave/cli/v2/flag_string_slice.go b/vendor/github.com/urfave/cli/v2/flag_string_slice.go
index 82eeac06d..82410dbc8 100644
--- a/vendor/github.com/urfave/cli/v2/flag_string_slice.go
+++ b/vendor/github.com/urfave/cli/v2/flag_string_slice.go
@@ -11,6 +11,7 @@ import (
// StringSlice wraps a []string to satisfy flag.Value
type StringSlice struct {
slice []string
+ separator separatorSpec
hasBeenSet bool
}
@@ -43,13 +44,17 @@ func (s *StringSlice) Set(value string) error {
return nil
}
- for _, t := range flagSplitMultiValues(value) {
+ for _, t := range s.separator.flagSplitMultiValues(value) {
s.slice = append(s.slice, t)
}
return nil
}
+func (s *StringSlice) WithSeparatorSpec(spec separatorSpec) {
+ s.separator = spec
+}
+
// String returns a readable representation of this value (for usage defaults)
func (s *StringSlice) String() string {
return fmt.Sprintf("%s", s.slice)
@@ -141,10 +146,11 @@ func (f *StringSliceFlag) Apply(set *flag.FlagSet) error {
setValue = f.Value.clone()
default:
setValue = new(StringSlice)
+ setValue.WithSeparatorSpec(f.separator)
}
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
- for _, s := range flagSplitMultiValues(val) {
+ for _, s := range f.separator.flagSplitMultiValues(val) {
if err := setValue.Set(strings.TrimSpace(s)); err != nil {
return fmt.Errorf("could not parse %q as string value from %s for flag %s: %s", val, source, f.Name, err)
}
@@ -163,6 +169,10 @@ func (f *StringSliceFlag) Apply(set *flag.FlagSet) error {
return nil
}
+func (f *StringSliceFlag) WithSeparatorSpec(spec separatorSpec) {
+ f.separator = spec
+}
+
// Get returns the flag’s value in the given Context.
func (f *StringSliceFlag) Get(ctx *Context) []string {
return ctx.StringSlice(f.Name)
diff --git a/vendor/github.com/urfave/cli/v2/flag_uint64_slice.go b/vendor/github.com/urfave/cli/v2/flag_uint64_slice.go
index 61bb30b55..e845dd525 100644
--- a/vendor/github.com/urfave/cli/v2/flag_uint64_slice.go
+++ b/vendor/github.com/urfave/cli/v2/flag_uint64_slice.go
@@ -11,6 +11,7 @@ import (
// Uint64Slice wraps []int64 to satisfy flag.Value
type Uint64Slice struct {
slice []uint64
+ separator separatorSpec
hasBeenSet bool
}
@@ -43,7 +44,7 @@ func (i *Uint64Slice) Set(value string) error {
return nil
}
- for _, s := range flagSplitMultiValues(value) {
+ for _, s := range i.separator.flagSplitMultiValues(value) {
tmp, err := strconv.ParseUint(strings.TrimSpace(s), 0, 64)
if err != nil {
return err
@@ -55,6 +56,10 @@ func (i *Uint64Slice) Set(value string) error {
return nil
}
+func (i *Uint64Slice) WithSeparatorSpec(spec separatorSpec) {
+ i.separator = spec
+}
+
// String returns a readable representation of this value (for usage defaults)
func (i *Uint64Slice) String() string {
v := i.slice
@@ -153,10 +158,11 @@ func (f *Uint64SliceFlag) Apply(set *flag.FlagSet) error {
setValue = f.Value.clone()
default:
setValue = new(Uint64Slice)
+ setValue.WithSeparatorSpec(f.separator)
}
if val, source, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok && val != "" {
- for _, s := range flagSplitMultiValues(val) {
+ for _, s := range f.separator.flagSplitMultiValues(val) {
if err := setValue.Set(strings.TrimSpace(s)); err != nil {
return fmt.Errorf("could not parse %q as uint64 slice value from %s for flag %s: %s", val, source, f.Name, err)
}
@@ -175,6 +181,10 @@ func (f *Uint64SliceFlag) Apply(set *flag.FlagSet) error {
return nil
}
+func (f *Uint64SliceFlag) WithSeparatorSpec(spec separatorSpec) {
+ f.separator = spec
+}
+
// Get returns the flag’s value in the given Context.
func (f *Uint64SliceFlag) Get(ctx *Context) []uint64 {
return ctx.Uint64Slice(f.Name)
diff --git a/vendor/github.com/urfave/cli/v2/flag_uint_slice.go b/vendor/github.com/urfave/cli/v2/flag_uint_slice.go
index 363aa657f..d2aed480d 100644
--- a/vendor/github.com/urfave/cli/v2/flag_uint_slice.go
+++ b/vendor/github.com/urfave/cli/v2/flag_uint_slice.go
@@ -11,6 +11,7 @@ import (
// UintSlice wraps []int to satisfy flag.Value
type UintSlice struct {
slice []uint
+ separator separatorSpec
hasBeenSet bool
}
@@ -54,7 +55,7 @@ func (i *UintSlice) Set(value string) error {
return nil
}
- for _, s := range flagSplitMultiValues(value) {
+ for _, s := range i.separator.flagSplitMultiValues(value) {
tmp, err := strconv.ParseUint(strings.TrimSpace(s), 0, 32)
if err != nil {
return err
@@ -66,6 +67,10 @@ func (i *UintSlice) Set(value string) error {
return nil
}
+func (i *UintSlice) WithSeparatorSpec(spec separatorSpec) {
+ i.separator = spec
+}
+
// String returns a readable representation of this value (for usage defaults)
func (i *UintSlice) String() string {
v := i.slice
@@ -164,10 +169,11 @@ func (f *UintSliceFlag) Apply(set *flag.FlagSet) error {
setValue = f.Value.clone()
default:
setValue = new(UintSlice)
+ setValue.WithSeparatorSpec(f.separator)
}
if val, source, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok && val != "" {
- for _, s := range flagSplitMultiValues(val) {
+ for _, s := range f.separator.flagSplitMultiValues(val) {
if err := setValue.Set(strings.TrimSpace(s)); err != nil {
return fmt.Errorf("could not parse %q as uint slice value from %s for flag %s: %s", val, source, f.Name, err)
}
@@ -186,6 +192,10 @@ func (f *UintSliceFlag) Apply(set *flag.FlagSet) error {
return nil
}
+func (f *UintSliceFlag) WithSeparatorSpec(spec separatorSpec) {
+ f.separator = spec
+}
+
// Get returns the flag’s value in the given Context.
func (f *UintSliceFlag) Get(ctx *Context) []uint {
return ctx.UintSlice(f.Name)
diff --git a/vendor/github.com/urfave/cli/v2/godoc-current.txt b/vendor/github.com/urfave/cli/v2/godoc-current.txt
index c1eb17057..599332b4f 100644
--- a/vendor/github.com/urfave/cli/v2/godoc-current.txt
+++ b/vendor/github.com/urfave/cli/v2/godoc-current.txt
@@ -1038,6 +1038,8 @@ func (f *Float64Slice) String() string
func (f *Float64Slice) Value() []float64
Value returns the slice of float64s set by this flag
+func (f *Float64Slice) WithSeparatorSpec(spec separatorSpec)
+
type Float64SliceFlag struct {
Name string
@@ -1113,6 +1115,8 @@ func (f *Float64SliceFlag) String() string
func (f *Float64SliceFlag) TakesValue() bool
TakesValue returns true if the flag takes a value, otherwise false
+func (f *Float64SliceFlag) WithSeparatorSpec(spec separatorSpec)
+
type Generic interface {
Set(value string) error
String() string
@@ -1279,6 +1283,8 @@ func (i *Int64Slice) String() string
func (i *Int64Slice) Value() []int64
Value returns the slice of ints set by this flag
+func (i *Int64Slice) WithSeparatorSpec(spec separatorSpec)
+
type Int64SliceFlag struct {
Name string
@@ -1354,6 +1360,8 @@ func (f *Int64SliceFlag) String() string
func (f *Int64SliceFlag) TakesValue() bool
TakesValue returns true of the flag takes a value, otherwise false
+func (f *Int64SliceFlag) WithSeparatorSpec(spec separatorSpec)
+
type IntFlag struct {
Name string
@@ -1449,6 +1457,8 @@ func (i *IntSlice) String() string
func (i *IntSlice) Value() []int
Value returns the slice of ints set by this flag
+func (i *IntSlice) WithSeparatorSpec(spec separatorSpec)
+
type IntSliceFlag struct {
Name string
@@ -1524,6 +1534,8 @@ func (f *IntSliceFlag) String() string
func (f *IntSliceFlag) TakesValue() bool
TakesValue returns true of the flag takes a value, otherwise false
+func (f *IntSliceFlag) WithSeparatorSpec(spec separatorSpec)
+
type InvalidFlagAccessFunc func(*Context, string)
InvalidFlagAccessFunc is executed when an invalid flag is accessed from the
context.
@@ -1792,6 +1804,8 @@ func (s *StringSlice) String() string
func (s *StringSlice) Value() []string
Value returns the slice of strings set by this flag
+func (s *StringSlice) WithSeparatorSpec(spec separatorSpec)
+
type StringSliceFlag struct {
Name string
@@ -1869,6 +1883,8 @@ func (f *StringSliceFlag) String() string
func (f *StringSliceFlag) TakesValue() bool
TakesValue returns true of the flag takes a value, otherwise false
+func (f *StringSliceFlag) WithSeparatorSpec(spec separatorSpec)
+
type SuggestCommandFunc func(commands []*Command, provided string) string
type SuggestFlagFunc func(flags []Flag, provided string, hideHelp bool) string
@@ -2063,6 +2079,8 @@ func (i *Uint64Slice) String() string
func (i *Uint64Slice) Value() []uint64
Value returns the slice of ints set by this flag
+func (i *Uint64Slice) WithSeparatorSpec(spec separatorSpec)
+
type Uint64SliceFlag struct {
Name string
@@ -2129,6 +2147,8 @@ func (f *Uint64SliceFlag) String() string
func (f *Uint64SliceFlag) TakesValue() bool
TakesValue returns true of the flag takes a value, otherwise false
+func (f *Uint64SliceFlag) WithSeparatorSpec(spec separatorSpec)
+
type UintFlag struct {
Name string
@@ -2224,6 +2244,8 @@ func (i *UintSlice) String() string
func (i *UintSlice) Value() []uint
Value returns the slice of ints set by this flag
+func (i *UintSlice) WithSeparatorSpec(spec separatorSpec)
+
type UintSliceFlag struct {
Name string
@@ -2290,6 +2312,8 @@ func (f *UintSliceFlag) String() string
func (f *UintSliceFlag) TakesValue() bool
TakesValue returns true of the flag takes a value, otherwise false
+func (f *UintSliceFlag) WithSeparatorSpec(spec separatorSpec)
+
type VisibleFlag interface {
Flag
diff --git a/vendor/github.com/urfave/cli/v2/zz_generated.flags.go b/vendor/github.com/urfave/cli/v2/zz_generated.flags.go
index 016951a3f..8c29f6ee0 100644
--- a/vendor/github.com/urfave/cli/v2/zz_generated.flags.go
+++ b/vendor/github.com/urfave/cli/v2/zz_generated.flags.go
@@ -25,6 +25,8 @@ type Float64SliceFlag struct {
defaultValue *Float64Slice
+ separator separatorSpec
+
Action func(*Context, []float64) error
}
@@ -120,6 +122,8 @@ type Int64SliceFlag struct {
defaultValue *Int64Slice
+ separator separatorSpec
+
Action func(*Context, []int64) error
}
@@ -164,6 +168,8 @@ type IntSliceFlag struct {
defaultValue *IntSlice
+ separator separatorSpec
+
Action func(*Context, []int) error
}
@@ -259,6 +265,8 @@ type StringSliceFlag struct {
defaultValue *StringSlice
+ separator separatorSpec
+
TakesFile bool
Action func(*Context, []string) error
@@ -358,6 +366,8 @@ type Uint64SliceFlag struct {
defaultValue *Uint64Slice
+ separator separatorSpec
+
Action func(*Context, []uint64) error
}
@@ -402,6 +412,8 @@ type UintSliceFlag struct {
defaultValue *UintSlice
+ separator separatorSpec
+
Action func(*Context, []uint) error
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
index d0337f3a5..0c3e48d55 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
@@ -33,6 +33,7 @@ const (
// config represents the configuration options available for the http.Handler
// and http.Transport types.
type config struct {
+ ServerName string
Tracer trace.Tracer
Meter metric.Meter
Propagators propagation.TextMapPropagator
@@ -198,3 +199,11 @@ func WithClientTrace(f func(context.Context) *httptrace.ClientTrace) Option {
c.ClientTrace = f
})
}
+
+// WithServerName returns an Option that sets the name of the (virtual) server
+// handling requests.
+func WithServerName(server string) Option {
+ return optionFunc(func(c *config) {
+ c.ServerName = server
+ })
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
index fd91e4162..60945801b 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
@@ -24,10 +24,10 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
- "go.opentelemetry.io/otel/metric/instrument/syncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/syncint64"
+ "go.opentelemetry.io/otel/metric/instrument"
"go.opentelemetry.io/otel/propagation"
- semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv"
"go.opentelemetry.io/otel/trace"
)
@@ -39,6 +39,7 @@ var _ http.Handler = &Handler{}
// to the span using the attribute.Keys defined in this package.
type Handler struct {
operation string
+ server string
handler http.Handler
tracer trace.Tracer
@@ -49,8 +50,8 @@ type Handler struct {
writeEvent bool
filters []Filter
spanNameFormatter func(string, *http.Request) string
- counters map[string]syncint64.Counter
- valueRecorders map[string]syncfloat64.Histogram
+ counters map[string]instrument.Int64Counter
+ valueRecorders map[string]instrument.Float64Histogram
publicEndpoint bool
publicEndpointFn func(*http.Request) bool
}
@@ -90,6 +91,7 @@ func (h *Handler) configure(c *config) {
h.spanNameFormatter = c.SpanNameFormatter
h.publicEndpoint = c.PublicEndpoint
h.publicEndpointFn = c.PublicEndpointFn
+ h.server = c.ServerName
}
func handleErr(err error) {
@@ -99,16 +101,16 @@ func handleErr(err error) {
}
func (h *Handler) createMeasures() {
- h.counters = make(map[string]syncint64.Counter)
- h.valueRecorders = make(map[string]syncfloat64.Histogram)
+ h.counters = make(map[string]instrument.Int64Counter)
+ h.valueRecorders = make(map[string]instrument.Float64Histogram)
- requestBytesCounter, err := h.meter.SyncInt64().Counter(RequestContentLength)
+ requestBytesCounter, err := h.meter.Int64Counter(RequestContentLength)
handleErr(err)
- responseBytesCounter, err := h.meter.SyncInt64().Counter(ResponseContentLength)
+ responseBytesCounter, err := h.meter.Int64Counter(ResponseContentLength)
handleErr(err)
- serverLatencyMeasure, err := h.meter.SyncFloat64().Histogram(ServerLatency)
+ serverLatencyMeasure, err := h.meter.Float64Histogram(ServerLatency)
handleErr(err)
h.counters[RequestContentLength] = requestBytesCounter
@@ -128,7 +130,14 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header))
- opts := h.spanStartOptions
+ opts := []trace.SpanStartOption{
+ trace.WithAttributes(httpconv.ServerRequest(h.server, r)...),
+ }
+ if h.server != "" {
+ hostAttr := semconv.NetHostNameKey.String(h.server)
+ opts = append(opts, trace.WithAttributes(hostAttr))
+ }
+ opts = append(opts, h.spanStartOptions...)
if h.publicEndpoint || (h.publicEndpointFn != nil && h.publicEndpointFn(r.WithContext(ctx))) {
opts = append(opts, trace.WithNewRoot())
// Linking incoming span context if any for public endpoint.
@@ -137,12 +146,6 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}
- opts = append([]trace.SpanStartOption{
- trace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", r)...),
- trace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(r)...),
- trace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(h.operation, "", r)...),
- }, opts...) // start with the configured options
-
tracer := h.tracer
if tracer == nil {
@@ -212,7 +215,10 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
setAfterServeAttributes(span, bw.read, rww.written, rww.statusCode, bw.err, rww.err)
// Add metrics
- attributes := append(labeler.Get(), semconv.HTTPServerMetricAttributesFromHTTPRequest(h.operation, r)...)
+ attributes := append(labeler.Get(), httpconv.ServerRequest(h.server, r)...)
+ if rww.statusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCodeKey.Int(rww.statusCode))
+ }
h.counters[RequestContentLength].Add(ctx, bw.read, attributes...)
h.counters[ResponseContentLength].Add(ctx, rww.written, attributes...)
@@ -236,8 +242,10 @@ func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int,
if wrote > 0 {
attributes = append(attributes, WroteBytesKey.Int64(wrote))
}
- attributes = append(attributes, semconv.HTTPAttributesFromHTTPStatusCode(statusCode)...)
- span.SetStatus(semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(statusCode, trace.SpanKindServer))
+ if statusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCodeKey.Int(statusCode))
+ }
+ span.SetStatus(httpconv.ServerStatus(statusCode))
if werr != nil && werr != io.EOF {
attributes = append(attributes, WriteErrorKey.String(werr.Error()))
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
index fd5e1e9bc..9dda7e1a9 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
@@ -23,7 +23,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
- semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
+ "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv"
"go.opentelemetry.io/otel/trace"
)
@@ -110,7 +110,7 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
}
r = r.WithContext(ctx)
- span.SetAttributes(semconv.HTTPClientAttributesFromHTTPRequest(r)...)
+ span.SetAttributes(httpconv.ClientRequest(r)...)
t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header))
res, err := t.rt.RoundTrip(r)
@@ -121,8 +121,8 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
return res, err
}
- span.SetAttributes(semconv.HTTPAttributesFromHTTPStatusCode(res.StatusCode)...)
- span.SetStatus(semconv.SpanStatusFromHTTPStatusCode(res.StatusCode))
+ span.SetAttributes(httpconv.ClientResponse(res)...)
+ span.SetStatus(httpconv.ClientStatus(res.StatusCode))
res.Body = newWrappedBody(span, res.Body)
return res, err
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
index 822491db0..9475e49bd 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
@@ -16,7 +16,7 @@ package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http
// Version is the current release version of the otelhttp instrumentation.
func Version() string {
- return "0.37.0"
+ return "0.38.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/otel/.lycheeignore b/vendor/go.opentelemetry.io/otel/.lycheeignore
index 545d63452..32e481275 100644
--- a/vendor/go.opentelemetry.io/otel/.lycheeignore
+++ b/vendor/go.opentelemetry.io/otel/.lycheeignore
@@ -1,3 +1,4 @@
http://localhost
http://jaeger-collector
https://github.com/open-telemetry/opentelemetry-go/milestone/
+https://github.com/open-telemetry/opentelemetry-go/projects
diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
index 9f130b8be..2bfe0a941 100644
--- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md
+++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
@@ -8,6 +8,139 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
+## [1.12.0/0.35.0] 2023-01-28
+
+### Added
+
+- The `WithInt64Callback` option to `go.opentelemetry.io/otel/metric/instrument`.
+ This options is used to configure `int64` Observer callbacks during their creation. (#3507)
+- The `WithFloat64Callback` option to `go.opentelemetry.io/otel/metric/instrument`.
+ This options is used to configure `float64` Observer callbacks during their creation. (#3507)
+- The `Producer` interface and `Reader.RegisterProducer(Producer)` to `go.opentelemetry.io/otel/sdk/metric`.
+ These additions are used to enable external metric Producers. (#3524)
+- The `Callback` function type to `go.opentelemetry.io/otel/metric`.
+ This new named function type is registered with a `Meter`. (#3564)
+- The `go.opentelemetry.io/otel/semconv/v1.13.0` package.
+ The package contains semantic conventions from the `v1.13.0` version of the OpenTelemetry specification. (#3499)
+ - The `EndUserAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientRequest` and `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `HTTPAttributesFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientResponse` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `HTTPClientAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `HTTPServerAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `HTTPServerMetricAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `NetAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `Transport` in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` and `ClientRequest` or `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `SpanStatusFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `SpanStatusFromHTTPStatusCodeAndSpanKind` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `ClientStatus` and `ServerStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`.
+ - The `Client` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Conn`.
+ - The `Server` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Listener`.
+- The `go.opentelemetry.io/otel/semconv/v1.14.0` package.
+ The package contains semantic conventions from the `v1.14.0` version of the OpenTelemetry specification. (#3566)
+- The `go.opentelemetry.io/otel/semconv/v1.15.0` package.
+ The package contains semantic conventions from the `v1.15.0` version of the OpenTelemetry specification. (#3578)
+- The `go.opentelemetry.io/otel/semconv/v1.16.0` package.
+ The package contains semantic conventions from the `v1.16.0` version of the OpenTelemetry specification. (#3579)
+- Metric instruments to `go.opentelemetry.io/otel/metric/instrument`.
+ These instruments are use as replacements of the depreacted `go.opentelemetry.io/otel/metric/instrument/{asyncfloat64,asyncint64,syncfloat64,syncint64}` packages.(#3575, #3586)
+ - `Float64ObservableCounter` replaces the `asyncfloat64.Counter`
+ - `Float64ObservableUpDownCounter` replaces the `asyncfloat64.UpDownCounter`
+ - `Float64ObservableGauge` replaces the `asyncfloat64.Gauge`
+ - `Int64ObservableCounter` replaces the `asyncint64.Counter`
+ - `Int64ObservableUpDownCounter` replaces the `asyncint64.UpDownCounter`
+ - `Int64ObservableGauge` replaces the `asyncint64.Gauge`
+ - `Float64Counter` replaces the `syncfloat64.Counter`
+ - `Float64UpDownCounter` replaces the `syncfloat64.UpDownCounter`
+ - `Float64Histogram` replaces the `syncfloat64.Histogram`
+ - `Int64Counter` replaces the `syncint64.Counter`
+ - `Int64UpDownCounter` replaces the `syncint64.UpDownCounter`
+ - `Int64Histogram` replaces the `syncint64.Histogram`
+- `NewTracerProvider` to `go.opentelemetry.io/otel/bridge/opentracing`.
+ This is used to create `WrapperTracer` instances from a `TracerProvider`. (#3116)
+- The `Extrema` type to `go.opentelemetry.io/otel/sdk/metric/metricdata`.
+ This type is used to represent min/max values and still be able to distinguish unset and zero values. (#3487)
+- The `go.opentelemetry.io/otel/semconv/v1.17.0` package.
+ The package contains semantic conventions from the `v1.17.0` version of the OpenTelemetry specification. (#3599)
+
+### Changed
+
+- Jaeger and Zipkin exporter use `github.com/go-logr/logr` as the logging interface, and add the `WithLogr` option. (#3497, #3500)
+- Instrument configuration in `go.opentelemetry.io/otel/metric/instrument` is split into specific options and confguration based on the instrument type. (#3507)
+ - Use the added `Int64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncint64`.
+ - Use the added `Float64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncfloat64`.
+ - Use the added `Int64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncint64`.
+ - Use the added `Float64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncfloat64`.
+- Return a `Registration` from the `RegisterCallback` method of a `Meter` in the `go.opentelemetry.io/otel/metric` package.
+ This `Registration` can be used to unregister callbacks. (#3522)
+- Global error handler uses an atomic value instead of a mutex. (#3543)
+- Add `NewMetricProducer` to `go.opentelemetry.io/otel/bridge/opencensus`, which can be used to pass OpenCensus metrics to an OpenTelemetry Reader. (#3541)
+- Global logger uses an atomic value instead of a mutex. (#3545)
+- The `Shutdown` method of the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` releases all computational resources when called the first time. (#3551)
+- The `Sampler` returned from `TraceIDRatioBased` `go.opentelemetry.io/otel/sdk/trace` now uses the rightmost bits for sampling decisions.
+ This fixes random sampling when using ID generators like `xray.IDGenerator` and increasing parity with other language implementations. (#3557)
+- Errors from `go.opentelemetry.io/otel/exporters/otlp/otlptrace` exporters are wrapped in erros identifying their signal name.
+ Existing users of the exporters attempting to identify specific errors will need to use `errors.Unwrap()` to get the underlying error. (#3516)
+- Exporters from `go.opentelemetry.io/otel/exporters/otlp` will print the final retryable error message when attempts to retry time out. (#3514)
+- The instrument kind names in `go.opentelemetry.io/otel/sdk/metric` are updated to match the API. (#3562)
+ - `InstrumentKindSyncCounter` is renamed to `InstrumentKindCounter`
+ - `InstrumentKindSyncUpDownCounter` is renamed to `InstrumentKindUpDownCounter`
+ - `InstrumentKindSyncHistogram` is renamed to `InstrumentKindHistogram`
+ - `InstrumentKindAsyncCounter` is renamed to `InstrumentKindObservableCounter`
+ - `InstrumentKindAsyncUpDownCounter` is renamed to `InstrumentKindObservableUpDownCounter`
+ - `InstrumentKindAsyncGauge` is renamed to `InstrumentKindObservableGauge`
+- The `RegisterCallback` method of the `Meter` in `go.opentelemetry.io/otel/metric` changed.
+ - The named `Callback` replaces the inline function parameter. (#3564)
+ - `Callback` is required to return an error. (#3576)
+ - `Callback` accepts the added `Observer` parameter added.
+ This new parameter is used by `Callback` implementations to observe values for asynchronous instruments instead of calling the `Observe` method of the instrument directly. (#3584)
+ - The slice of `instrument.Asynchronous` is now passed as a variadic argument. (#3587)
+- The exporter from `go.opentelemetry.io/otel/exporters/zipkin` is updated to use the `v1.16.0` version of semantic conventions.
+ This means it no longer uses the removed `net.peer.ip` or `http.host` attributes to determine the remote endpoint.
+ Instead it uses the `net.sock.peer` attributes. (#3581)
+- The `Min` and `Max` fields of the `HistogramDataPoint` in `go.opentelemetry.io/otel/sdk/metric/metricdata` are now defined with the added `Extrema` type instead of a `*float64`. (#3487)
+
+### Fixed
+
+- Asynchronous instruments that use sum aggregators and attribute filters correctly add values from equivalent attribute sets that have been filtered. (#3439, #3549)
+- The `RegisterCallback` method of the `Meter` from `go.opentelemetry.io/otel/sdk/metric` only registers a callback for instruments created by that meter.
+ Trying to register a callback with instruments from a different meter will result in an error being returned. (#3584)
+
+### Deprecated
+
+- The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` is deprecated.
+ Use `NewMetricProducer` instead. (#3541)
+- The `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is deprecated.
+ Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575)
+- The `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is deprecated.
+ Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575)
+- The `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is deprecated.
+ Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575)
+- The `go.opentelemetry.io/otel/metric/instrument/syncint64` package is deprecated.
+ Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575)
+- The `NewWrappedTracerProvider` in `go.opentelemetry.io/otel/bridge/opentracing` is now deprecated.
+ Use `NewTracerProvider` instead. (#3116)
+
+### Removed
+
+- The deprecated `go.opentelemetry.io/otel/sdk/metric/view` package is removed. (#3520)
+- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncint64` is removed.
+ Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530)
+ - The `Counter` method is replaced by `Meter.Int64ObservableCounter`
+ - The `UpDownCounter` method is replaced by `Meter.Int64ObservableUpDownCounter`
+ - The `Gauge` method is replaced by `Meter.Int64ObservableGauge`
+- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncfloat64` is removed.
+ Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530)
+ - The `Counter` method is replaced by `Meter.Float64ObservableCounter`
+ - The `UpDownCounter` method is replaced by `Meter.Float64ObservableUpDownCounter`
+ - The `Gauge` method is replaced by `Meter.Float64ObservableGauge`
+- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncint64` is removed.
+ Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530)
+ - The `Counter` method is replaced by `Meter.Int64Counter`
+ - The `UpDownCounter` method is replaced by `Meter.Int64UpDownCounter`
+ - The `Histogram` method is replaced by `Meter.Int64Histogram`
+- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncfloat64` is removed.
+ Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530)
+ - The `Counter` method is replaced by `Meter.Float64Counter`
+ - The `UpDownCounter` method is replaced by `Meter.Float64UpDownCounter`
+ - The `Histogram` method is replaced by `Meter.Float64Histogram`
+
## [1.11.2/0.34.0] 2022-12-05
### Added
@@ -58,7 +191,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Prevent duplicate Prometheus description, unit, and type. (#3469)
- Prevents panic when using incorrect `attribute.Value.As[Type]Slice()`. (#3489)
-## Removed
+### Removed
- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.Client` interface is removed. (#3486)
- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.New` function is removed. Use the `otlpmetric[http|grpc].New` directly. (#3486)
@@ -2087,7 +2220,8 @@ It contains api and sdk for trace and meter.
- CircleCI build CI manifest files.
- CODEOWNERS file to track owners of this project.
-[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.11.2...HEAD
+[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.12.0...HEAD
+[1.12.0/0.35.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.12.0
[1.11.2/0.34.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.2
[1.11.1/0.33.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.1
[1.11.0/0.32.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.0
diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile
index 68cdfef7d..befb040a7 100644
--- a/vendor/go.opentelemetry.io/otel/Makefile
+++ b/vendor/go.opentelemetry.io/otel/Makefile
@@ -208,11 +208,11 @@ check-clean-work-tree:
SEMCONVPKG ?= "semconv/"
.PHONY: semconv-generate
semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT)
- @[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry specification tag"; exit 1 )
- @[ "$(OTEL_SPEC_REPO)" ] || ( echo "OTEL_SPEC_REPO unset: missing path to opentelemetry specification repo"; exit 1 )
- @$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/trace" -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- @$(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/resource" -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- @$(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
+ [ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry specification tag"; exit 1 )
+ [ "$(OTEL_SPEC_REPO)" ] || ( echo "OTEL_SPEC_REPO unset: missing path to opentelemetry specification repo"; exit 1 )
+ $(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=span -p conventionType=trace -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
+ $(SEMCONVGEN) -i "$(OTEL_SPEC_REPO)/semantic_conventions/." --only=resource -p conventionType=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
+ $(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
.PHONY: prerelease
prerelease: | $(MULTIMOD)
diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md
index 71e576254..77d56c936 100644
--- a/vendor/go.opentelemetry.io/otel/RELEASING.md
+++ b/vendor/go.opentelemetry.io/otel/RELEASING.md
@@ -6,20 +6,25 @@ New versions of the [OpenTelemetry specification] mean new versions of the `semc
The `semconv-generate` make target is used for this.
1. Checkout a local copy of the [OpenTelemetry specification] to the desired release tag.
-2. Run the `make semconv-generate ...` target from this repository.
+2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest`
+3. Run the `make semconv-generate ...` target from this repository.
For example,
```sh
-export TAG="v1.7.0" # Change to the release version you are generating.
+export TAG="v1.13.0" # Change to the release version you are generating.
export OTEL_SPEC_REPO="/absolute/path/to/opentelemetry-specification"
-git -C "$OTEL_SPEC_REPO" checkout "tags/$TAG"
+git -C "$OTEL_SPEC_REPO" checkout "tags/$TAG" -b "$TAG"
+docker pull otel/semconvgen:latest
make semconv-generate # Uses the exported TAG and OTEL_SPEC_REPO.
```
This should create a new sub-package of [`semconv`](./semconv).
Ensure things look correct before submitting a pull request to include the addition.
+**Note**, the generation code was changed to generate versions >= 1.13.
+To generate versions prior to this, checkout the old release of this repository (i.e. [2fe8861](https://github.com/open-telemetry/opentelemetry-go/commit/2fe8861a24e20088c065b116089862caf9e3cd8b)).
+
## Pre-Release
First, decide which module sets will be released and update their versions
diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go
index 36cf09f72..ecd363ab5 100644
--- a/vendor/go.opentelemetry.io/otel/handler.go
+++ b/vendor/go.opentelemetry.io/otel/handler.go
@@ -17,7 +17,8 @@ package otel // import "go.opentelemetry.io/otel"
import (
"log"
"os"
- "sync"
+ "sync/atomic"
+ "unsafe"
)
var (
@@ -34,28 +35,26 @@ var (
)
type delegator struct {
- lock *sync.RWMutex
- eh ErrorHandler
+ delegate unsafe.Pointer
}
func (d *delegator) Handle(err error) {
- d.lock.RLock()
- defer d.lock.RUnlock()
- d.eh.Handle(err)
+ d.getDelegate().Handle(err)
+}
+
+func (d *delegator) getDelegate() ErrorHandler {
+ return *(*ErrorHandler)(atomic.LoadPointer(&d.delegate))
}
// setDelegate sets the ErrorHandler delegate.
func (d *delegator) setDelegate(eh ErrorHandler) {
- d.lock.Lock()
- defer d.lock.Unlock()
- d.eh = eh
+ atomic.StorePointer(&d.delegate, unsafe.Pointer(&eh))
}
func defaultErrorHandler() *delegator {
- return &delegator{
- lock: &sync.RWMutex{},
- eh: &errLogger{l: log.New(os.Stderr, "", log.LstdFlags)},
- }
+ d := &delegator{}
+ d.setDelegate(&errLogger{l: log.New(os.Stderr, "", log.LstdFlags)})
+ return d
}
// errLogger logs errors if no delegate is set, otherwise they are delegated.
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
index ccb325871..293c08961 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
@@ -17,7 +17,8 @@ package global // import "go.opentelemetry.io/otel/internal/global"
import (
"log"
"os"
- "sync"
+ "sync/atomic"
+ "unsafe"
"github.com/go-logr/logr"
"github.com/go-logr/stdr"
@@ -27,37 +28,36 @@ import (
//
// The default logger uses stdr which is backed by the standard `log.Logger`
// interface. This logger will only show messages at the Error Level.
-var globalLogger logr.Logger = stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))
-var globalLoggerLock = &sync.RWMutex{}
+var globalLogger unsafe.Pointer
+
+func init() {
+ SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile)))
+}
// SetLogger overrides the globalLogger with l.
//
// To see Info messages use a logger with `l.V(1).Enabled() == true`
// To see Debug messages use a logger with `l.V(5).Enabled() == true`.
func SetLogger(l logr.Logger) {
- globalLoggerLock.Lock()
- defer globalLoggerLock.Unlock()
- globalLogger = l
+ atomic.StorePointer(&globalLogger, unsafe.Pointer(&l))
+}
+
+func getLogger() logr.Logger {
+ return *(*logr.Logger)(atomic.LoadPointer(&globalLogger))
}
// Info prints messages about the general state of the API or SDK.
// This should usually be less then 5 messages a minute.
func Info(msg string, keysAndValues ...interface{}) {
- globalLoggerLock.RLock()
- defer globalLoggerLock.RUnlock()
- globalLogger.V(1).Info(msg, keysAndValues...)
+ getLogger().V(1).Info(msg, keysAndValues...)
}
// Error prints messages about exceptional states of the API or SDK.
func Error(err error, msg string, keysAndValues ...interface{}) {
- globalLoggerLock.RLock()
- defer globalLoggerLock.RUnlock()
- globalLogger.Error(err, msg, keysAndValues...)
+ getLogger().Error(err, msg, keysAndValues...)
}
// Debug prints messages about all internal changes in the API or SDK.
func Debug(msg string, keysAndValues ...interface{}) {
- globalLoggerLock.RLock()
- defer globalLoggerLock.RUnlock()
- globalLogger.V(5).Info(msg, keysAndValues...)
+ getLogger().V(5).Info(msg, keysAndValues...)
}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64.go
new file mode 100644
index 000000000..2f624bfe0
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64.go
@@ -0,0 +1,131 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package instrument // import "go.opentelemetry.io/otel/metric/instrument"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/metric/unit"
+)
+
+// Float64Observable describes a set of instruments used asynchronously to
+// record float64 measurements once per collection cycle. Observations of
+// these instruments are only made within a callback.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64Observable interface {
+ Asynchronous
+
+ float64Observable()
+}
+
+// Float64ObservableCounter is an instrument used to asynchronously record
+// increasing float64 measurements once per collection cycle. Observations are
+// only made within a callback for this instrument. The value observed is
+// assumed the to be the cumulative sum of the count.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64ObservableCounter interface{ Float64Observable }
+
+// Float64ObservableUpDownCounter is an instrument used to asynchronously
+// record float64 measurements once per collection cycle. Observations are only
+// made within a callback for this instrument. The value observed is assumed
+// the to be the cumulative sum of the count.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64ObservableUpDownCounter interface{ Float64Observable }
+
+// Float64ObservableGauge is an instrument used to asynchronously record
+// instantaneous float64 measurements once per collection cycle. Observations
+// are only made within a callback for this instrument.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64ObservableGauge interface{ Float64Observable }
+
+// Float64Observer is a recorder of float64 measurements.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64Observer interface {
+ Observe(value float64, attributes ...attribute.KeyValue)
+}
+
+// Float64Callback is a function registered with a Meter that makes
+// observations for a Float64Observerable instrument it is registered with.
+// Calls to the Float64Observer record measurement values for the
+// Float64Observable.
+//
+// The function needs to complete in a finite amount of time and the deadline
+// of the passed context is expected to be honored.
+//
+// The function needs to make unique observations across all registered
+// Float64Callbacks. Meaning, it should not report measurements with the same
+// attributes as another Float64Callbacks also registered for the same
+// instrument.
+//
+// The function needs to be concurrent safe.
+type Float64Callback func(context.Context, Float64Observer) error
+
+// Float64ObserverConfig contains options for Asynchronous instruments that
+// observe float64 values.
+type Float64ObserverConfig struct {
+ description string
+ unit unit.Unit
+ callbacks []Float64Callback
+}
+
+// NewFloat64ObserverConfig returns a new Float64ObserverConfig with all opts
+// applied.
+func NewFloat64ObserverConfig(opts ...Float64ObserverOption) Float64ObserverConfig {
+ var config Float64ObserverConfig
+ for _, o := range opts {
+ config = o.applyFloat64Observer(config)
+ }
+ return config
+}
+
+// Description returns the Config description.
+func (c Float64ObserverConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the Config unit.
+func (c Float64ObserverConfig) Unit() unit.Unit {
+ return c.unit
+}
+
+// Callbacks returns the Config callbacks.
+func (c Float64ObserverConfig) Callbacks() []Float64Callback {
+ return c.callbacks
+}
+
+// Float64ObserverOption applies options to float64 Observer instruments.
+type Float64ObserverOption interface {
+ applyFloat64Observer(Float64ObserverConfig) Float64ObserverConfig
+}
+
+type float64ObserverOptionFunc func(Float64ObserverConfig) Float64ObserverConfig
+
+func (fn float64ObserverOptionFunc) applyFloat64Observer(cfg Float64ObserverConfig) Float64ObserverConfig {
+ return fn(cfg)
+}
+
+// WithFloat64Callback adds callback to be called for an instrument.
+func WithFloat64Callback(callback Float64Callback) Float64ObserverOption {
+ return float64ObserverOptionFunc(func(cfg Float64ObserverConfig) Float64ObserverConfig {
+ cfg.callbacks = append(cfg.callbacks, callback)
+ return cfg
+ })
+}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64/asyncfloat64.go
deleted file mode 100644
index 330a14c2f..000000000
--- a/vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64/asyncfloat64.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package asyncfloat64 // import "go.opentelemetry.io/otel/metric/instrument/asyncfloat64"
-
-import (
- "context"
-
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/metric/instrument"
-)
-
-// InstrumentProvider provides access to individual instruments.
-//
-// Warning: methods may be added to this interface in minor releases.
-type InstrumentProvider interface {
- // Counter creates an instrument for recording increasing values.
- Counter(name string, opts ...instrument.Option) (Counter, error)
-
- // UpDownCounter creates an instrument for recording changes of a value.
- UpDownCounter(name string, opts ...instrument.Option) (UpDownCounter, error)
-
- // Gauge creates an instrument for recording the current value.
- Gauge(name string, opts ...instrument.Option) (Gauge, error)
-}
-
-// Counter is an instrument that records increasing values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type Counter interface {
- // Observe records the state of the instrument to be x. Implementations
- // will assume x to be the cumulative sum of the count.
- //
- // It is only valid to call this within a callback. If called outside of the
- // registered callback it should have no effect on the instrument, and an
- // error will be reported via the error handler.
- Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue)
-
- instrument.Asynchronous
-}
-
-// UpDownCounter is an instrument that records increasing or decreasing values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type UpDownCounter interface {
- // Observe records the state of the instrument to be x. Implementations
- // will assume x to be the cumulative sum of the count.
- //
- // It is only valid to call this within a callback. If called outside of the
- // registered callback it should have no effect on the instrument, and an
- // error will be reported via the error handler.
- Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue)
-
- instrument.Asynchronous
-}
-
-// Gauge is an instrument that records independent readings.
-//
-// Warning: methods may be added to this interface in minor releases.
-type Gauge interface {
- // Observe records the state of the instrument to be x.
- //
- // It is only valid to call this within a callback. If called outside of the
- // registered callback it should have no effect on the instrument, and an
- // error will be reported via the error handler.
- Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue)
-
- instrument.Asynchronous
-}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64.go
new file mode 100644
index 000000000..ac0d09d90
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64.go
@@ -0,0 +1,131 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package instrument // import "go.opentelemetry.io/otel/metric/instrument"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/metric/unit"
+)
+
+// Int64Observable describes a set of instruments used asynchronously to record
+// int64 measurements once per collection cycle. Observations of these
+// instruments are only made within a callback.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Int64Observable interface {
+ Asynchronous
+
+ int64Observable()
+}
+
+// Int64ObservableCounter is an instrument used to asynchronously record
+// increasing int64 measurements once per collection cycle. Observations are
+// only made within a callback for this instrument. The value observed is
+// assumed the to be the cumulative sum of the count.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Int64ObservableCounter interface{ Int64Observable }
+
+// Int64ObservableUpDownCounter is an instrument used to asynchronously record
+// int64 measurements once per collection cycle. Observations are only made
+// within a callback for this instrument. The value observed is assumed the to
+// be the cumulative sum of the count.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Int64ObservableUpDownCounter interface{ Int64Observable }
+
+// Int64ObservableGauge is an instrument used to asynchronously record
+// instantaneous int64 measurements once per collection cycle. Observations are
+// only made within a callback for this instrument.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Int64ObservableGauge interface{ Int64Observable }
+
+// Int64Observer is a recorder of int64 measurements.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Int64Observer interface {
+ Observe(value int64, attributes ...attribute.KeyValue)
+}
+
+// Int64Callback is a function registered with a Meter that makes
+// observations for a Int64Observerable instrument it is registered with.
+// Calls to the Int64Observer record measurement values for the
+// Int64Observable.
+//
+// The function needs to complete in a finite amount of time and the deadline
+// of the passed context is expected to be honored.
+//
+// The function needs to make unique observations across all registered
+// Int64Callback. Meaning, it should not report measurements with the same
+// attributes as another Int64Callbacks also registered for the same
+// instrument.
+//
+// The function needs to be concurrent safe.
+type Int64Callback func(context.Context, Int64Observer) error
+
+// Int64ObserverConfig contains options for Asynchronous instruments that
+// observe int64 values.
+type Int64ObserverConfig struct {
+ description string
+ unit unit.Unit
+ callbacks []Int64Callback
+}
+
+// NewInt64ObserverConfig returns a new Int64ObserverConfig with all opts
+// applied.
+func NewInt64ObserverConfig(opts ...Int64ObserverOption) Int64ObserverConfig {
+ var config Int64ObserverConfig
+ for _, o := range opts {
+ config = o.applyInt64Observer(config)
+ }
+ return config
+}
+
+// Description returns the Config description.
+func (c Int64ObserverConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the Config unit.
+func (c Int64ObserverConfig) Unit() unit.Unit {
+ return c.unit
+}
+
+// Callbacks returns the Config callbacks.
+func (c Int64ObserverConfig) Callbacks() []Int64Callback {
+ return c.callbacks
+}
+
+// Int64ObserverOption applies options to int64 Observer instruments.
+type Int64ObserverOption interface {
+ applyInt64Observer(Int64ObserverConfig) Int64ObserverConfig
+}
+
+type int64ObserverOptionFunc func(Int64ObserverConfig) Int64ObserverConfig
+
+func (fn int64ObserverOptionFunc) applyInt64Observer(cfg Int64ObserverConfig) Int64ObserverConfig {
+ return fn(cfg)
+}
+
+// WithInt64Callback adds callback to be called for an instrument.
+func WithInt64Callback(callback Int64Callback) Int64ObserverOption {
+ return int64ObserverOptionFunc(func(cfg Int64ObserverConfig) Int64ObserverConfig {
+ cfg.callbacks = append(cfg.callbacks, callback)
+ return cfg
+ })
+}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64/asyncint64.go
deleted file mode 100644
index 4fce9963c..000000000
--- a/vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64/asyncint64.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package asyncint64 // import "go.opentelemetry.io/otel/metric/instrument/asyncint64"
-
-import (
- "context"
-
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/metric/instrument"
-)
-
-// InstrumentProvider provides access to individual instruments.
-//
-// Warning: methods may be added to this interface in minor releases.
-type InstrumentProvider interface {
- // Counter creates an instrument for recording increasing values.
- Counter(name string, opts ...instrument.Option) (Counter, error)
-
- // UpDownCounter creates an instrument for recording changes of a value.
- UpDownCounter(name string, opts ...instrument.Option) (UpDownCounter, error)
-
- // Gauge creates an instrument for recording the current value.
- Gauge(name string, opts ...instrument.Option) (Gauge, error)
-}
-
-// Counter is an instrument that records increasing values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type Counter interface {
- // Observe records the state of the instrument to be x. Implementations
- // will assume x to be the cumulative sum of the count.
- //
- // It is only valid to call this within a callback. If called outside of the
- // registered callback it should have no effect on the instrument, and an
- // error will be reported via the error handler.
- Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue)
-
- instrument.Asynchronous
-}
-
-// UpDownCounter is an instrument that records increasing or decreasing values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type UpDownCounter interface {
- // Observe records the state of the instrument to be x. Implementations
- // will assume x to be the cumulative sum of the count.
- //
- // It is only valid to call this within a callback. If called outside of the
- // registered callback it should have no effect on the instrument, and an
- // error will be reported via the error handler.
- Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue)
-
- instrument.Asynchronous
-}
-
-// Gauge is an instrument that records independent readings.
-//
-// Warning: methods may be added to this interface in minor releases.
-type Gauge interface {
- // Observe records the state of the instrument to be x.
- //
- // It is only valid to call this within a callback. If called outside of the
- // registered callback it should have no effect on the instrument, and an
- // error will be reported via the error handler.
- Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue)
-
- instrument.Asynchronous
-}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/config.go b/vendor/go.opentelemetry.io/otel/metric/instrument/config.go
deleted file mode 100644
index 8778bce16..000000000
--- a/vendor/go.opentelemetry.io/otel/metric/instrument/config.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package instrument // import "go.opentelemetry.io/otel/metric/instrument"
-
-import "go.opentelemetry.io/otel/metric/unit"
-
-// Config contains options for metric instrument descriptors.
-type Config struct {
- description string
- unit unit.Unit
-}
-
-// Description describes the instrument in human-readable terms.
-func (cfg Config) Description() string {
- return cfg.description
-}
-
-// Unit describes the measurement unit for an instrument.
-func (cfg Config) Unit() unit.Unit {
- return cfg.unit
-}
-
-// Option is an interface for applying metric instrument options.
-type Option interface {
- applyInstrument(Config) Config
-}
-
-// NewConfig creates a new Config and applies all the given options.
-func NewConfig(opts ...Option) Config {
- var config Config
- for _, o := range opts {
- config = o.applyInstrument(config)
- }
- return config
-}
-
-type optionFunc func(Config) Config
-
-func (fn optionFunc) applyInstrument(cfg Config) Config {
- return fn(cfg)
-}
-
-// WithDescription applies provided description.
-func WithDescription(desc string) Option {
- return optionFunc(func(cfg Config) Config {
- cfg.description = desc
- return cfg
- })
-}
-
-// WithUnit applies provided unit.
-func WithUnit(u unit.Unit) Option {
- return optionFunc(func(cfg Config) Config {
- cfg.unit = u
- return cfg
- })
-}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument/instrument.go
index e1bbb850d..c583be6fb 100644
--- a/vendor/go.opentelemetry.io/otel/metric/instrument/instrument.go
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument/instrument.go
@@ -14,6 +14,8 @@
package instrument // import "go.opentelemetry.io/otel/metric/instrument"
+import "go.opentelemetry.io/otel/metric/unit"
+
// Asynchronous instruments are instruments that are updated within a Callback.
// If an instrument is observed outside of it's callback it should be an error.
//
@@ -28,3 +30,61 @@ type Asynchronous interface {
type Synchronous interface {
synchronous()
}
+
+// Option applies options to all instruments.
+type Option interface {
+ Float64ObserverOption
+ Int64ObserverOption
+ Float64Option
+ Int64Option
+}
+
+type descOpt string
+
+func (o descOpt) applyFloat64(c Float64Config) Float64Config {
+ c.description = string(o)
+ return c
+}
+
+func (o descOpt) applyInt64(c Int64Config) Int64Config {
+ c.description = string(o)
+ return c
+}
+
+func (o descOpt) applyFloat64Observer(c Float64ObserverConfig) Float64ObserverConfig {
+ c.description = string(o)
+ return c
+}
+
+func (o descOpt) applyInt64Observer(c Int64ObserverConfig) Int64ObserverConfig {
+ c.description = string(o)
+ return c
+}
+
+// WithDescription sets the instrument description.
+func WithDescription(desc string) Option { return descOpt(desc) }
+
+type unitOpt unit.Unit
+
+func (o unitOpt) applyFloat64(c Float64Config) Float64Config {
+ c.unit = unit.Unit(o)
+ return c
+}
+
+func (o unitOpt) applyInt64(c Int64Config) Int64Config {
+ c.unit = unit.Unit(o)
+ return c
+}
+
+func (o unitOpt) applyFloat64Observer(c Float64ObserverConfig) Float64ObserverConfig {
+ c.unit = unit.Unit(o)
+ return c
+}
+
+func (o unitOpt) applyInt64Observer(c Int64ObserverConfig) Int64ObserverConfig {
+ c.unit = unit.Unit(o)
+ return c
+}
+
+// WithUnit sets the instrument unit.
+func WithUnit(u unit.Unit) Option { return unitOpt(u) }
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64.go
new file mode 100644
index 000000000..d8f6ba9f4
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64.go
@@ -0,0 +1,86 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package instrument // import "go.opentelemetry.io/otel/metric/instrument"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/metric/unit"
+)
+
+// Float64Counter is an instrument that records increasing float64 values.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64Counter interface {
+ // Add records a change to the counter.
+ Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
+
+ Synchronous
+}
+
+// Float64UpDownCounter is an instrument that records increasing or decreasing
+// float64 values.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64UpDownCounter interface {
+ // Add records a change to the counter.
+ Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
+
+ Synchronous
+}
+
+// Float64Histogram is an instrument that records a distribution of float64
+// values.
+//
+// Warning: methods may be added to this interface in minor releases.
+type Float64Histogram interface {
+ // Record adds an additional value to the distribution.
+ Record(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
+
+ Synchronous
+}
+
+// Float64Config contains options for Asynchronous instruments that
+// observe float64 values.
+type Float64Config struct {
+ description string
+ unit unit.Unit
+}
+
+// Float64Config contains options for Synchronous instruments that record
+// float64 values.
+func NewFloat64Config(opts ...Float64Option) Float64Config {
+ var config Float64Config
+ for _, o := range opts {
+ config = o.applyFloat64(config)
+ }
+ return config
+}
+
+// Description returns the Config description.
+func (c Float64Config) Description() string {
+ return c.description
+}
+
+// Unit returns the Config unit.
+func (c Float64Config) Unit() unit.Unit {
+ return c.unit
+}
+
+// Float64Option applies options to synchronous float64 instruments.
+type Float64Option interface {
+ applyFloat64(Float64Config) Float64Config
+}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64/syncfloat64.go
deleted file mode 100644
index 2ec192f70..000000000
--- a/vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64/syncfloat64.go
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package syncfloat64 // import "go.opentelemetry.io/otel/metric/instrument/syncfloat64"
-
-import (
- "context"
-
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/metric/instrument"
-)
-
-// InstrumentProvider provides access to individual instruments.
-//
-// Warning: methods may be added to this interface in minor releases.
-type InstrumentProvider interface {
- // Counter creates an instrument for recording increasing values.
- Counter(name string, opts ...instrument.Option) (Counter, error)
- // UpDownCounter creates an instrument for recording changes of a value.
- UpDownCounter(name string, opts ...instrument.Option) (UpDownCounter, error)
- // Histogram creates an instrument for recording a distribution of values.
- Histogram(name string, opts ...instrument.Option) (Histogram, error)
-}
-
-// Counter is an instrument that records increasing values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type Counter interface {
- // Add records a change to the counter.
- Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
-
- instrument.Synchronous
-}
-
-// UpDownCounter is an instrument that records increasing or decreasing values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type UpDownCounter interface {
- // Add records a change to the counter.
- Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
-
- instrument.Synchronous
-}
-
-// Histogram is an instrument that records a distribution of values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type Histogram interface {
- // Record adds an additional value to the distribution.
- Record(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
-
- instrument.Synchronous
-}
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument/syncint64/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/instrument/syncint64.go
similarity index 50%
rename from vendor/go.opentelemetry.io/otel/metric/instrument/syncint64/syncint64.go
rename to vendor/go.opentelemetry.io/otel/metric/instrument/syncint64.go
index 03b5d53e6..96bf730e4 100644
--- a/vendor/go.opentelemetry.io/otel/metric/instrument/syncint64/syncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument/syncint64.go
@@ -12,53 +12,75 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package syncint64 // import "go.opentelemetry.io/otel/metric/instrument/syncint64"
+package instrument // import "go.opentelemetry.io/otel/metric/instrument"
import (
"context"
"go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/metric/instrument"
+ "go.opentelemetry.io/otel/metric/unit"
)
-// InstrumentProvider provides access to individual instruments.
+// Int64Counter is an instrument that records increasing int64 values.
//
// Warning: methods may be added to this interface in minor releases.
-type InstrumentProvider interface {
- // Counter creates an instrument for recording increasing values.
- Counter(name string, opts ...instrument.Option) (Counter, error)
- // UpDownCounter creates an instrument for recording changes of a value.
- UpDownCounter(name string, opts ...instrument.Option) (UpDownCounter, error)
- // Histogram creates an instrument for recording a distribution of values.
- Histogram(name string, opts ...instrument.Option) (Histogram, error)
-}
-
-// Counter is an instrument that records increasing values.
-//
-// Warning: methods may be added to this interface in minor releases.
-type Counter interface {
+type Int64Counter interface {
// Add records a change to the counter.
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
- instrument.Synchronous
+ Synchronous
}
-// UpDownCounter is an instrument that records increasing or decreasing values.
+// Int64UpDownCounter is an instrument that records increasing or decreasing
+// int64 values.
//
// Warning: methods may be added to this interface in minor releases.
-type UpDownCounter interface {
+type Int64UpDownCounter interface {
// Add records a change to the counter.
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
- instrument.Synchronous
+ Synchronous
}
-// Histogram is an instrument that records a distribution of values.
+// Int64Histogram is an instrument that records a distribution of int64
+// values.
//
// Warning: methods may be added to this interface in minor releases.
-type Histogram interface {
+type Int64Histogram interface {
// Record adds an additional value to the distribution.
Record(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
- instrument.Synchronous
+ Synchronous
+}
+
+// Int64Config contains options for Synchronous instruments that record int64
+// values.
+type Int64Config struct {
+ description string
+ unit unit.Unit
+}
+
+// NewInt64Config returns a new Int64Config with all opts
+// applied.
+func NewInt64Config(opts ...Int64Option) Int64Config {
+ var config Int64Config
+ for _, o := range opts {
+ config = o.applyInt64(config)
+ }
+ return config
+}
+
+// Description returns the Config description.
+func (c Int64Config) Description() string {
+ return c.description
+}
+
+// Unit returns the Config unit.
+func (c Int64Config) Unit() unit.Unit {
+ return c.unit
+}
+
+// Int64Option applies options to synchronous int64 instruments.
+type Int64Option interface {
+ applyInt64(Int64Config) Int64Config
}
diff --git a/vendor/go.opentelemetry.io/otel/metric/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/metric/internal/global/instruments.go
index 7cce2bd15..d1480fa5f 100644
--- a/vendor/go.opentelemetry.io/otel/metric/internal/global/instruments.go
+++ b/vendor/go.opentelemetry.io/otel/metric/internal/global/instruments.go
@@ -22,23 +22,27 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/instrument"
- "go.opentelemetry.io/otel/metric/instrument/asyncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/asyncint64"
- "go.opentelemetry.io/otel/metric/instrument/syncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/syncint64"
)
-type afCounter struct {
- name string
- opts []instrument.Option
-
- delegate atomic.Value //asyncfloat64.Counter
-
- instrument.Asynchronous
+// unwrapper unwraps to return the underlying instrument implementation.
+type unwrapper interface {
+ Unwrap() instrument.Asynchronous
}
+type afCounter struct {
+ instrument.Float64Observable
+
+ name string
+ opts []instrument.Float64ObserverOption
+
+ delegate atomic.Value //instrument.Float64ObservableCounter
+}
+
+var _ unwrapper = (*afCounter)(nil)
+var _ instrument.Float64ObservableCounter = (*afCounter)(nil)
+
func (i *afCounter) setDelegate(m metric.Meter) {
- ctr, err := m.AsyncFloat64().Counter(i.name, i.opts...)
+ ctr, err := m.Float64ObservableCounter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -46,30 +50,27 @@ func (i *afCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *afCounter) Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue) {
+func (i *afCounter) Unwrap() instrument.Asynchronous {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(asyncfloat64.Counter).Observe(ctx, x, attrs...)
- }
-}
-
-func (i *afCounter) unwrap() instrument.Asynchronous {
- if ctr := i.delegate.Load(); ctr != nil {
- return ctr.(asyncfloat64.Counter)
+ return ctr.(instrument.Float64ObservableCounter)
}
return nil
}
type afUpDownCounter struct {
+ instrument.Float64Observable
+
name string
- opts []instrument.Option
+ opts []instrument.Float64ObserverOption
- delegate atomic.Value //asyncfloat64.UpDownCounter
-
- instrument.Asynchronous
+ delegate atomic.Value //instrument.Float64ObservableUpDownCounter
}
+var _ unwrapper = (*afUpDownCounter)(nil)
+var _ instrument.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil)
+
func (i *afUpDownCounter) setDelegate(m metric.Meter) {
- ctr, err := m.AsyncFloat64().UpDownCounter(i.name, i.opts...)
+ ctr, err := m.Float64ObservableUpDownCounter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -77,30 +78,27 @@ func (i *afUpDownCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *afUpDownCounter) Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue) {
+func (i *afUpDownCounter) Unwrap() instrument.Asynchronous {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(asyncfloat64.UpDownCounter).Observe(ctx, x, attrs...)
- }
-}
-
-func (i *afUpDownCounter) unwrap() instrument.Asynchronous {
- if ctr := i.delegate.Load(); ctr != nil {
- return ctr.(asyncfloat64.UpDownCounter)
+ return ctr.(instrument.Float64ObservableUpDownCounter)
}
return nil
}
type afGauge struct {
+ instrument.Float64Observable
+
name string
- opts []instrument.Option
+ opts []instrument.Float64ObserverOption
- delegate atomic.Value //asyncfloat64.Gauge
-
- instrument.Asynchronous
+ delegate atomic.Value //instrument.Float64ObservableGauge
}
+var _ unwrapper = (*afGauge)(nil)
+var _ instrument.Float64ObservableGauge = (*afGauge)(nil)
+
func (i *afGauge) setDelegate(m metric.Meter) {
- ctr, err := m.AsyncFloat64().Gauge(i.name, i.opts...)
+ ctr, err := m.Float64ObservableGauge(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -108,30 +106,27 @@ func (i *afGauge) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *afGauge) Observe(ctx context.Context, x float64, attrs ...attribute.KeyValue) {
+func (i *afGauge) Unwrap() instrument.Asynchronous {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(asyncfloat64.Gauge).Observe(ctx, x, attrs...)
- }
-}
-
-func (i *afGauge) unwrap() instrument.Asynchronous {
- if ctr := i.delegate.Load(); ctr != nil {
- return ctr.(asyncfloat64.Gauge)
+ return ctr.(instrument.Float64ObservableGauge)
}
return nil
}
type aiCounter struct {
+ instrument.Int64Observable
+
name string
- opts []instrument.Option
+ opts []instrument.Int64ObserverOption
- delegate atomic.Value //asyncint64.Counter
-
- instrument.Asynchronous
+ delegate atomic.Value //instrument.Int64ObservableCounter
}
+var _ unwrapper = (*aiCounter)(nil)
+var _ instrument.Int64ObservableCounter = (*aiCounter)(nil)
+
func (i *aiCounter) setDelegate(m metric.Meter) {
- ctr, err := m.AsyncInt64().Counter(i.name, i.opts...)
+ ctr, err := m.Int64ObservableCounter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -139,30 +134,27 @@ func (i *aiCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *aiCounter) Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue) {
+func (i *aiCounter) Unwrap() instrument.Asynchronous {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(asyncint64.Counter).Observe(ctx, x, attrs...)
- }
-}
-
-func (i *aiCounter) unwrap() instrument.Asynchronous {
- if ctr := i.delegate.Load(); ctr != nil {
- return ctr.(asyncint64.Counter)
+ return ctr.(instrument.Int64ObservableCounter)
}
return nil
}
type aiUpDownCounter struct {
+ instrument.Int64Observable
+
name string
- opts []instrument.Option
+ opts []instrument.Int64ObserverOption
- delegate atomic.Value //asyncint64.UpDownCounter
-
- instrument.Asynchronous
+ delegate atomic.Value //instrument.Int64ObservableUpDownCounter
}
+var _ unwrapper = (*aiUpDownCounter)(nil)
+var _ instrument.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil)
+
func (i *aiUpDownCounter) setDelegate(m metric.Meter) {
- ctr, err := m.AsyncInt64().UpDownCounter(i.name, i.opts...)
+ ctr, err := m.Int64ObservableUpDownCounter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -170,30 +162,27 @@ func (i *aiUpDownCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *aiUpDownCounter) Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue) {
+func (i *aiUpDownCounter) Unwrap() instrument.Asynchronous {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(asyncint64.UpDownCounter).Observe(ctx, x, attrs...)
- }
-}
-
-func (i *aiUpDownCounter) unwrap() instrument.Asynchronous {
- if ctr := i.delegate.Load(); ctr != nil {
- return ctr.(asyncint64.UpDownCounter)
+ return ctr.(instrument.Int64ObservableUpDownCounter)
}
return nil
}
type aiGauge struct {
+ instrument.Int64Observable
+
name string
- opts []instrument.Option
+ opts []instrument.Int64ObserverOption
- delegate atomic.Value //asyncint64.Gauge
-
- instrument.Asynchronous
+ delegate atomic.Value //instrument.Int64ObservableGauge
}
+var _ unwrapper = (*aiGauge)(nil)
+var _ instrument.Int64ObservableGauge = (*aiGauge)(nil)
+
func (i *aiGauge) setDelegate(m metric.Meter) {
- ctr, err := m.AsyncInt64().Gauge(i.name, i.opts...)
+ ctr, err := m.Int64ObservableGauge(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -201,15 +190,9 @@ func (i *aiGauge) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *aiGauge) Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue) {
+func (i *aiGauge) Unwrap() instrument.Asynchronous {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(asyncint64.Gauge).Observe(ctx, x, attrs...)
- }
-}
-
-func (i *aiGauge) unwrap() instrument.Asynchronous {
- if ctr := i.delegate.Load(); ctr != nil {
- return ctr.(asyncint64.Gauge)
+ return ctr.(instrument.Int64ObservableGauge)
}
return nil
}
@@ -217,15 +200,17 @@ func (i *aiGauge) unwrap() instrument.Asynchronous {
// Sync Instruments.
type sfCounter struct {
name string
- opts []instrument.Option
+ opts []instrument.Float64Option
- delegate atomic.Value //syncfloat64.Counter
+ delegate atomic.Value //instrument.Float64Counter
instrument.Synchronous
}
+var _ instrument.Float64Counter = (*sfCounter)(nil)
+
func (i *sfCounter) setDelegate(m metric.Meter) {
- ctr, err := m.SyncFloat64().Counter(i.name, i.opts...)
+ ctr, err := m.Float64Counter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -235,21 +220,23 @@ func (i *sfCounter) setDelegate(m metric.Meter) {
func (i *sfCounter) Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue) {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(syncfloat64.Counter).Add(ctx, incr, attrs...)
+ ctr.(instrument.Float64Counter).Add(ctx, incr, attrs...)
}
}
type sfUpDownCounter struct {
name string
- opts []instrument.Option
+ opts []instrument.Float64Option
- delegate atomic.Value //syncfloat64.UpDownCounter
+ delegate atomic.Value //instrument.Float64UpDownCounter
instrument.Synchronous
}
+var _ instrument.Float64UpDownCounter = (*sfUpDownCounter)(nil)
+
func (i *sfUpDownCounter) setDelegate(m metric.Meter) {
- ctr, err := m.SyncFloat64().UpDownCounter(i.name, i.opts...)
+ ctr, err := m.Float64UpDownCounter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -259,21 +246,23 @@ func (i *sfUpDownCounter) setDelegate(m metric.Meter) {
func (i *sfUpDownCounter) Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue) {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(syncfloat64.UpDownCounter).Add(ctx, incr, attrs...)
+ ctr.(instrument.Float64UpDownCounter).Add(ctx, incr, attrs...)
}
}
type sfHistogram struct {
name string
- opts []instrument.Option
+ opts []instrument.Float64Option
- delegate atomic.Value //syncfloat64.Histogram
+ delegate atomic.Value //instrument.Float64Histogram
instrument.Synchronous
}
+var _ instrument.Float64Histogram = (*sfHistogram)(nil)
+
func (i *sfHistogram) setDelegate(m metric.Meter) {
- ctr, err := m.SyncFloat64().Histogram(i.name, i.opts...)
+ ctr, err := m.Float64Histogram(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -283,21 +272,23 @@ func (i *sfHistogram) setDelegate(m metric.Meter) {
func (i *sfHistogram) Record(ctx context.Context, x float64, attrs ...attribute.KeyValue) {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(syncfloat64.Histogram).Record(ctx, x, attrs...)
+ ctr.(instrument.Float64Histogram).Record(ctx, x, attrs...)
}
}
type siCounter struct {
name string
- opts []instrument.Option
+ opts []instrument.Int64Option
- delegate atomic.Value //syncint64.Counter
+ delegate atomic.Value //instrument.Int64Counter
instrument.Synchronous
}
+var _ instrument.Int64Counter = (*siCounter)(nil)
+
func (i *siCounter) setDelegate(m metric.Meter) {
- ctr, err := m.SyncInt64().Counter(i.name, i.opts...)
+ ctr, err := m.Int64Counter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -307,21 +298,23 @@ func (i *siCounter) setDelegate(m metric.Meter) {
func (i *siCounter) Add(ctx context.Context, x int64, attrs ...attribute.KeyValue) {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(syncint64.Counter).Add(ctx, x, attrs...)
+ ctr.(instrument.Int64Counter).Add(ctx, x, attrs...)
}
}
type siUpDownCounter struct {
name string
- opts []instrument.Option
+ opts []instrument.Int64Option
- delegate atomic.Value //syncint64.UpDownCounter
+ delegate atomic.Value //instrument.Int64UpDownCounter
instrument.Synchronous
}
+var _ instrument.Int64UpDownCounter = (*siUpDownCounter)(nil)
+
func (i *siUpDownCounter) setDelegate(m metric.Meter) {
- ctr, err := m.SyncInt64().UpDownCounter(i.name, i.opts...)
+ ctr, err := m.Int64UpDownCounter(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -331,21 +324,23 @@ func (i *siUpDownCounter) setDelegate(m metric.Meter) {
func (i *siUpDownCounter) Add(ctx context.Context, x int64, attrs ...attribute.KeyValue) {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(syncint64.UpDownCounter).Add(ctx, x, attrs...)
+ ctr.(instrument.Int64UpDownCounter).Add(ctx, x, attrs...)
}
}
type siHistogram struct {
name string
- opts []instrument.Option
+ opts []instrument.Int64Option
- delegate atomic.Value //syncint64.Histogram
+ delegate atomic.Value //instrument.Int64Histogram
instrument.Synchronous
}
+var _ instrument.Int64Histogram = (*siHistogram)(nil)
+
func (i *siHistogram) setDelegate(m metric.Meter) {
- ctr, err := m.SyncInt64().Histogram(i.name, i.opts...)
+ ctr, err := m.Int64Histogram(i.name, i.opts...)
if err != nil {
otel.Handle(err)
return
@@ -355,6 +350,6 @@ func (i *siHistogram) setDelegate(m metric.Meter) {
func (i *siHistogram) Record(ctx context.Context, x int64, attrs ...attribute.KeyValue) {
if ctr := i.delegate.Load(); ctr != nil {
- ctr.(syncint64.Histogram).Record(ctx, x, attrs...)
+ ctr.(instrument.Int64Histogram).Record(ctx, x, attrs...)
}
}
diff --git a/vendor/go.opentelemetry.io/otel/metric/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/metric/internal/global/meter.go
index 0fa924f39..8acf63286 100644
--- a/vendor/go.opentelemetry.io/otel/metric/internal/global/meter.go
+++ b/vendor/go.opentelemetry.io/otel/metric/internal/global/meter.go
@@ -15,17 +15,13 @@
package global // import "go.opentelemetry.io/otel/metric/internal/global"
import (
- "context"
+ "container/list"
"sync"
"sync/atomic"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/instrument"
- "go.opentelemetry.io/otel/metric/instrument/asyncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/asyncint64"
- "go.opentelemetry.io/otel/metric/instrument/syncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/syncint64"
)
// meterProvider is a placeholder for a configured SDK MeterProvider.
@@ -109,7 +105,8 @@ type meter struct {
mtx sync.Mutex
instruments []delegatedInstrument
- callbacks []delegatedCallback
+
+ registry list.List
delegate atomic.Value // metric.Meter
}
@@ -135,52 +132,167 @@ func (m *meter) setDelegate(provider metric.MeterProvider) {
inst.setDelegate(meter)
}
- for _, callback := range m.callbacks {
- callback.setDelegate(meter)
+ for e := m.registry.Front(); e != nil; e = e.Next() {
+ r := e.Value.(*registration)
+ r.setDelegate(meter)
+ m.registry.Remove(e)
}
m.instruments = nil
- m.callbacks = nil
+ m.registry.Init()
}
-// AsyncInt64 is the namespace for the Asynchronous Integer instruments.
-//
-// To Observe data with instruments it must be registered in a callback.
-func (m *meter) AsyncInt64() asyncint64.InstrumentProvider {
+func (m *meter) Int64Counter(name string, options ...instrument.Int64Option) (instrument.Int64Counter, error) {
if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.AsyncInt64()
+ return del.Int64Counter(name, options...)
}
- return (*aiInstProvider)(m)
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &siCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
}
-// AsyncFloat64 is the namespace for the Asynchronous Float instruments.
-//
-// To Observe data with instruments it must be registered in a callback.
-func (m *meter) AsyncFloat64() asyncfloat64.InstrumentProvider {
+func (m *meter) Int64UpDownCounter(name string, options ...instrument.Int64Option) (instrument.Int64UpDownCounter, error) {
if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.AsyncFloat64()
+ return del.Int64UpDownCounter(name, options...)
}
- return (*afInstProvider)(m)
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &siUpDownCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Int64Histogram(name string, options ...instrument.Int64Option) (instrument.Int64Histogram, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Int64Histogram(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &siHistogram{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Int64ObservableCounter(name string, options ...instrument.Int64ObserverOption) (instrument.Int64ObservableCounter, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Int64ObservableCounter(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &aiCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Int64ObservableUpDownCounter(name string, options ...instrument.Int64ObserverOption) (instrument.Int64ObservableUpDownCounter, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Int64ObservableUpDownCounter(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &aiUpDownCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Int64ObservableGauge(name string, options ...instrument.Int64ObserverOption) (instrument.Int64ObservableGauge, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Int64ObservableGauge(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &aiGauge{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Float64Counter(name string, options ...instrument.Float64Option) (instrument.Float64Counter, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64Counter(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &sfCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Float64UpDownCounter(name string, options ...instrument.Float64Option) (instrument.Float64UpDownCounter, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64UpDownCounter(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &sfUpDownCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Float64Histogram(name string, options ...instrument.Float64Option) (instrument.Float64Histogram, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64Histogram(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &sfHistogram{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Float64ObservableCounter(name string, options ...instrument.Float64ObserverOption) (instrument.Float64ObservableCounter, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64ObservableCounter(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &afCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Float64ObservableUpDownCounter(name string, options ...instrument.Float64ObserverOption) (instrument.Float64ObservableUpDownCounter, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64ObservableUpDownCounter(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &afUpDownCounter{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
+func (m *meter) Float64ObservableGauge(name string, options ...instrument.Float64ObserverOption) (instrument.Float64ObservableGauge, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64ObservableGauge(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &afGauge{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
}
// RegisterCallback captures the function that will be called during Collect.
-//
-// It is only valid to call Observe within the scope of the passed function,
-// and only on the instruments that were registered with this call.
-func (m *meter) RegisterCallback(insts []instrument.Asynchronous, function func(context.Context)) error {
+func (m *meter) RegisterCallback(f metric.Callback, insts ...instrument.Asynchronous) (metric.Registration, error) {
if del, ok := m.delegate.Load().(metric.Meter); ok {
insts = unwrapInstruments(insts)
- return del.RegisterCallback(insts, function)
+ return del.RegisterCallback(f, insts...)
}
m.mtx.Lock()
defer m.mtx.Unlock()
- m.callbacks = append(m.callbacks, delegatedCallback{
- instruments: insts,
- function: function,
- })
- return nil
+ reg := ®istration{instruments: insts, function: f}
+ e := m.registry.PushBack(reg)
+ reg.unreg = func() error {
+ m.mtx.Lock()
+ _ = m.registry.Remove(e)
+ m.mtx.Unlock()
+ return nil
+ }
+ return reg, nil
}
type wrapped interface {
@@ -201,147 +313,42 @@ func unwrapInstruments(instruments []instrument.Asynchronous) []instrument.Async
return out
}
-// SyncInt64 is the namespace for the Synchronous Integer instruments.
-func (m *meter) SyncInt64() syncint64.InstrumentProvider {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.SyncInt64()
- }
- return (*siInstProvider)(m)
-}
-
-// SyncFloat64 is the namespace for the Synchronous Float instruments.
-func (m *meter) SyncFloat64() syncfloat64.InstrumentProvider {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.SyncFloat64()
- }
- return (*sfInstProvider)(m)
-}
-
-type delegatedCallback struct {
+type registration struct {
instruments []instrument.Asynchronous
- function func(context.Context)
+ function metric.Callback
+
+ unreg func() error
+ unregMu sync.Mutex
}
-func (c *delegatedCallback) setDelegate(m metric.Meter) {
+func (c *registration) setDelegate(m metric.Meter) {
insts := unwrapInstruments(c.instruments)
- err := m.RegisterCallback(insts, c.function)
+
+ c.unregMu.Lock()
+ defer c.unregMu.Unlock()
+
+ if c.unreg == nil {
+ // Unregister already called.
+ return
+ }
+
+ reg, err := m.RegisterCallback(c.function, insts...)
if err != nil {
otel.Handle(err)
}
+
+ c.unreg = reg.Unregister
}
-type afInstProvider meter
+func (c *registration) Unregister() error {
+ c.unregMu.Lock()
+ defer c.unregMu.Unlock()
+ if c.unreg == nil {
+ // Unregister already called.
+ return nil
+ }
-// Counter creates an instrument for recording increasing values.
-func (ip *afInstProvider) Counter(name string, opts ...instrument.Option) (asyncfloat64.Counter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &afCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// UpDownCounter creates an instrument for recording changes of a value.
-func (ip *afInstProvider) UpDownCounter(name string, opts ...instrument.Option) (asyncfloat64.UpDownCounter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &afUpDownCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// Gauge creates an instrument for recording the current value.
-func (ip *afInstProvider) Gauge(name string, opts ...instrument.Option) (asyncfloat64.Gauge, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &afGauge{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-type aiInstProvider meter
-
-// Counter creates an instrument for recording increasing values.
-func (ip *aiInstProvider) Counter(name string, opts ...instrument.Option) (asyncint64.Counter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &aiCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// UpDownCounter creates an instrument for recording changes of a value.
-func (ip *aiInstProvider) UpDownCounter(name string, opts ...instrument.Option) (asyncint64.UpDownCounter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &aiUpDownCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// Gauge creates an instrument for recording the current value.
-func (ip *aiInstProvider) Gauge(name string, opts ...instrument.Option) (asyncint64.Gauge, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &aiGauge{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-type sfInstProvider meter
-
-// Counter creates an instrument for recording increasing values.
-func (ip *sfInstProvider) Counter(name string, opts ...instrument.Option) (syncfloat64.Counter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &sfCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// UpDownCounter creates an instrument for recording changes of a value.
-func (ip *sfInstProvider) UpDownCounter(name string, opts ...instrument.Option) (syncfloat64.UpDownCounter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &sfUpDownCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// Histogram creates an instrument for recording a distribution of values.
-func (ip *sfInstProvider) Histogram(name string, opts ...instrument.Option) (syncfloat64.Histogram, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &sfHistogram{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-type siInstProvider meter
-
-// Counter creates an instrument for recording increasing values.
-func (ip *siInstProvider) Counter(name string, opts ...instrument.Option) (syncint64.Counter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &siCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// UpDownCounter creates an instrument for recording changes of a value.
-func (ip *siInstProvider) UpDownCounter(name string, opts ...instrument.Option) (syncint64.UpDownCounter, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &siUpDownCounter{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
-}
-
-// Histogram creates an instrument for recording a distribution of values.
-func (ip *siInstProvider) Histogram(name string, opts ...instrument.Option) (syncint64.Histogram, error) {
- ip.mtx.Lock()
- defer ip.mtx.Unlock()
- ctr := &siHistogram{name: name, opts: opts}
- ip.instruments = append(ip.instruments, ctr)
- return ctr, nil
+ var err error
+ err, c.unreg = c.unreg(), nil
+ return err
}
diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go
index 23e6853af..f1e917e93 100644
--- a/vendor/go.opentelemetry.io/otel/metric/meter.go
+++ b/vendor/go.opentelemetry.io/otel/metric/meter.go
@@ -17,11 +17,8 @@ package metric // import "go.opentelemetry.io/otel/metric"
import (
"context"
+ "go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric/instrument"
- "go.opentelemetry.io/otel/metric/instrument/asyncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/asyncint64"
- "go.opentelemetry.io/otel/metric/instrument/syncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/syncint64"
)
// MeterProvider provides access to named Meter instances, for instrumenting
@@ -41,24 +38,101 @@ type MeterProvider interface {
//
// Warning: methods may be added to this interface in minor releases.
type Meter interface {
- // AsyncInt64 is the namespace for the Asynchronous Integer instruments.
- //
- // To Observe data with instruments it must be registered in a callback.
- AsyncInt64() asyncint64.InstrumentProvider
+ // Int64Counter returns a new instrument identified by name and configured
+ // with options. The instrument is used to synchronously record increasing
+ // int64 measurements during a computational operation.
+ Int64Counter(name string, options ...instrument.Int64Option) (instrument.Int64Counter, error)
+ // Int64UpDownCounter returns a new instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // int64 measurements during a computational operation.
+ Int64UpDownCounter(name string, options ...instrument.Int64Option) (instrument.Int64UpDownCounter, error)
+ // Int64Histogram returns a new instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // the distribution of int64 measurements during a computational operation.
+ Int64Histogram(name string, options ...instrument.Int64Option) (instrument.Int64Histogram, error)
+ // Int64ObservableCounter returns a new instrument identified by name and
+ // configured with options. The instrument is used to asynchronously record
+ // increasing int64 measurements once per a measurement collection cycle.
+ Int64ObservableCounter(name string, options ...instrument.Int64ObserverOption) (instrument.Int64ObservableCounter, error)
+ // Int64ObservableUpDownCounter returns a new instrument identified by name
+ // and configured with options. The instrument is used to asynchronously
+ // record int64 measurements once per a measurement collection cycle.
+ Int64ObservableUpDownCounter(name string, options ...instrument.Int64ObserverOption) (instrument.Int64ObservableUpDownCounter, error)
+ // Int64ObservableGauge returns a new instrument identified by name and
+ // configured with options. The instrument is used to asynchronously record
+ // instantaneous int64 measurements once per a measurement collection
+ // cycle.
+ Int64ObservableGauge(name string, options ...instrument.Int64ObserverOption) (instrument.Int64ObservableGauge, error)
- // AsyncFloat64 is the namespace for the Asynchronous Float instruments
- //
- // To Observe data with instruments it must be registered in a callback.
- AsyncFloat64() asyncfloat64.InstrumentProvider
+ // Float64Counter returns a new instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // increasing float64 measurements during a computational operation.
+ Float64Counter(name string, options ...instrument.Float64Option) (instrument.Float64Counter, error)
+ // Float64UpDownCounter returns a new instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // float64 measurements during a computational operation.
+ Float64UpDownCounter(name string, options ...instrument.Float64Option) (instrument.Float64UpDownCounter, error)
+ // Float64Histogram returns a new instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // the distribution of float64 measurements during a computational
+ // operation.
+ Float64Histogram(name string, options ...instrument.Float64Option) (instrument.Float64Histogram, error)
+ // Float64ObservableCounter returns a new instrument identified by name and
+ // configured with options. The instrument is used to asynchronously record
+ // increasing float64 measurements once per a measurement collection cycle.
+ Float64ObservableCounter(name string, options ...instrument.Float64ObserverOption) (instrument.Float64ObservableCounter, error)
+ // Float64ObservableUpDownCounter returns a new instrument identified by
+ // name and configured with options. The instrument is used to
+ // asynchronously record float64 measurements once per a measurement
+ // collection cycle.
+ Float64ObservableUpDownCounter(name string, options ...instrument.Float64ObserverOption) (instrument.Float64ObservableUpDownCounter, error)
+ // Float64ObservableGauge returns a new instrument identified by name and
+ // configured with options. The instrument is used to asynchronously record
+ // instantaneous float64 measurements once per a measurement collection
+ // cycle.
+ Float64ObservableGauge(name string, options ...instrument.Float64ObserverOption) (instrument.Float64ObservableGauge, error)
- // RegisterCallback captures the function that will be called during Collect.
+ // RegisterCallback registers f to be called during the collection of a
+ // measurement cycle.
//
- // It is only valid to call Observe within the scope of the passed function,
- // and only on the instruments that were registered with this call.
- RegisterCallback(insts []instrument.Asynchronous, function func(context.Context)) error
-
- // SyncInt64 is the namespace for the Synchronous Integer instruments
- SyncInt64() syncint64.InstrumentProvider
- // SyncFloat64 is the namespace for the Synchronous Float instruments
- SyncFloat64() syncfloat64.InstrumentProvider
+ // If Unregister of the returned Registration is called, f needs to be
+ // unregistered and not called during collection.
+ //
+ // The instruments f is registered with are the only instruments that f may
+ // observe values for.
+ //
+ // If no instruments are passed, f should not be registered nor called
+ // during collection.
+ RegisterCallback(f Callback, instruments ...instrument.Asynchronous) (Registration, error)
+}
+
+// Callback is a function registered with a Meter that makes observations for
+// the set of instruments it is registered with. The Observer parameter is used
+// to record measurment observations for these instruments.
+//
+// The function needs to complete in a finite amount of time and the deadline
+// of the passed context is expected to be honored.
+//
+// The function needs to make unique observations across all registered
+// Callbacks. Meaning, it should not report measurements for an instrument with
+// the same attributes as another Callback will report.
+//
+// The function needs to be concurrent safe.
+type Callback func(context.Context, Observer) error
+
+// Observer records measurements for multiple instruments in a Callback.
+type Observer interface {
+ // ObserveFloat64 records the float64 value with attributes for obsrv.
+ ObserveFloat64(obsrv instrument.Float64Observable, value float64, attributes ...attribute.KeyValue)
+ // ObserveInt64 records the int64 value with attributes for obsrv.
+ ObserveInt64(obsrv instrument.Int64Observable, value int64, attributes ...attribute.KeyValue)
+}
+
+// Registration is an token representing the unique registration of a callback
+// for a set of instruments with a Meter.
+type Registration interface {
+ // Unregister removes the callback registration from a Meter.
+ //
+ // This method needs to be idempotent and concurrent safe.
+ Unregister() error
}
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop.go b/vendor/go.opentelemetry.io/otel/metric/noop.go
index e8b9a9a14..c586627ae 100644
--- a/vendor/go.opentelemetry.io/otel/metric/noop.go
+++ b/vendor/go.opentelemetry.io/otel/metric/noop.go
@@ -19,10 +19,6 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric/instrument"
- "go.opentelemetry.io/otel/metric/instrument/asyncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/asyncint64"
- "go.opentelemetry.io/otel/metric/instrument/syncfloat64"
- "go.opentelemetry.io/otel/metric/instrument/syncint64"
)
// NewNoopMeterProvider creates a MeterProvider that does not record any metrics.
@@ -43,104 +39,126 @@ func NewNoopMeter() Meter {
type noopMeter struct{}
-// AsyncInt64 creates an instrument that does not record any metrics.
-func (noopMeter) AsyncInt64() asyncint64.InstrumentProvider {
- return nonrecordingAsyncInt64Instrument{}
+func (noopMeter) Int64Counter(string, ...instrument.Int64Option) (instrument.Int64Counter, error) {
+ return nonrecordingSyncInt64Instrument{}, nil
}
-// AsyncFloat64 creates an instrument that does not record any metrics.
-func (noopMeter) AsyncFloat64() asyncfloat64.InstrumentProvider {
- return nonrecordingAsyncFloat64Instrument{}
+func (noopMeter) Int64UpDownCounter(string, ...instrument.Int64Option) (instrument.Int64UpDownCounter, error) {
+ return nonrecordingSyncInt64Instrument{}, nil
}
-// SyncInt64 creates an instrument that does not record any metrics.
-func (noopMeter) SyncInt64() syncint64.InstrumentProvider {
- return nonrecordingSyncInt64Instrument{}
+func (noopMeter) Int64Histogram(string, ...instrument.Int64Option) (instrument.Int64Histogram, error) {
+ return nonrecordingSyncInt64Instrument{}, nil
}
-// SyncFloat64 creates an instrument that does not record any metrics.
-func (noopMeter) SyncFloat64() syncfloat64.InstrumentProvider {
- return nonrecordingSyncFloat64Instrument{}
+func (noopMeter) Int64ObservableCounter(string, ...instrument.Int64ObserverOption) (instrument.Int64ObservableCounter, error) {
+ return nonrecordingAsyncInt64Instrument{}, nil
+}
+
+func (noopMeter) Int64ObservableUpDownCounter(string, ...instrument.Int64ObserverOption) (instrument.Int64ObservableUpDownCounter, error) {
+ return nonrecordingAsyncInt64Instrument{}, nil
+}
+
+func (noopMeter) Int64ObservableGauge(string, ...instrument.Int64ObserverOption) (instrument.Int64ObservableGauge, error) {
+ return nonrecordingAsyncInt64Instrument{}, nil
+}
+
+func (noopMeter) Float64Counter(string, ...instrument.Float64Option) (instrument.Float64Counter, error) {
+ return nonrecordingSyncFloat64Instrument{}, nil
+}
+
+func (noopMeter) Float64UpDownCounter(string, ...instrument.Float64Option) (instrument.Float64UpDownCounter, error) {
+ return nonrecordingSyncFloat64Instrument{}, nil
+}
+
+func (noopMeter) Float64Histogram(string, ...instrument.Float64Option) (instrument.Float64Histogram, error) {
+ return nonrecordingSyncFloat64Instrument{}, nil
+}
+
+func (noopMeter) Float64ObservableCounter(string, ...instrument.Float64ObserverOption) (instrument.Float64ObservableCounter, error) {
+ return nonrecordingAsyncFloat64Instrument{}, nil
+}
+
+func (noopMeter) Float64ObservableUpDownCounter(string, ...instrument.Float64ObserverOption) (instrument.Float64ObservableUpDownCounter, error) {
+ return nonrecordingAsyncFloat64Instrument{}, nil
+}
+
+func (noopMeter) Float64ObservableGauge(string, ...instrument.Float64ObserverOption) (instrument.Float64ObservableGauge, error) {
+ return nonrecordingAsyncFloat64Instrument{}, nil
}
// RegisterCallback creates a register callback that does not record any metrics.
-func (noopMeter) RegisterCallback([]instrument.Asynchronous, func(context.Context)) error {
- return nil
+func (noopMeter) RegisterCallback(Callback, ...instrument.Asynchronous) (Registration, error) {
+ return noopReg{}, nil
}
+type noopReg struct{}
+
+func (noopReg) Unregister() error { return nil }
+
type nonrecordingAsyncFloat64Instrument struct {
- instrument.Asynchronous
+ instrument.Float64Observable
}
var (
- _ asyncfloat64.InstrumentProvider = nonrecordingAsyncFloat64Instrument{}
- _ asyncfloat64.Counter = nonrecordingAsyncFloat64Instrument{}
- _ asyncfloat64.UpDownCounter = nonrecordingAsyncFloat64Instrument{}
- _ asyncfloat64.Gauge = nonrecordingAsyncFloat64Instrument{}
+ _ instrument.Float64ObservableCounter = nonrecordingAsyncFloat64Instrument{}
+ _ instrument.Float64ObservableUpDownCounter = nonrecordingAsyncFloat64Instrument{}
+ _ instrument.Float64ObservableGauge = nonrecordingAsyncFloat64Instrument{}
)
-func (n nonrecordingAsyncFloat64Instrument) Counter(string, ...instrument.Option) (asyncfloat64.Counter, error) {
+func (n nonrecordingAsyncFloat64Instrument) Counter(string, ...instrument.Float64ObserverOption) (instrument.Float64ObservableCounter, error) {
return n, nil
}
-func (n nonrecordingAsyncFloat64Instrument) UpDownCounter(string, ...instrument.Option) (asyncfloat64.UpDownCounter, error) {
+func (n nonrecordingAsyncFloat64Instrument) UpDownCounter(string, ...instrument.Float64ObserverOption) (instrument.Float64ObservableUpDownCounter, error) {
return n, nil
}
-func (n nonrecordingAsyncFloat64Instrument) Gauge(string, ...instrument.Option) (asyncfloat64.Gauge, error) {
+func (n nonrecordingAsyncFloat64Instrument) Gauge(string, ...instrument.Float64ObserverOption) (instrument.Float64ObservableGauge, error) {
return n, nil
}
-func (nonrecordingAsyncFloat64Instrument) Observe(context.Context, float64, ...attribute.KeyValue) {
-
-}
-
type nonrecordingAsyncInt64Instrument struct {
- instrument.Asynchronous
+ instrument.Int64Observable
}
var (
- _ asyncint64.InstrumentProvider = nonrecordingAsyncInt64Instrument{}
- _ asyncint64.Counter = nonrecordingAsyncInt64Instrument{}
- _ asyncint64.UpDownCounter = nonrecordingAsyncInt64Instrument{}
- _ asyncint64.Gauge = nonrecordingAsyncInt64Instrument{}
+ _ instrument.Int64ObservableCounter = nonrecordingAsyncInt64Instrument{}
+ _ instrument.Int64ObservableUpDownCounter = nonrecordingAsyncInt64Instrument{}
+ _ instrument.Int64ObservableGauge = nonrecordingAsyncInt64Instrument{}
)
-func (n nonrecordingAsyncInt64Instrument) Counter(string, ...instrument.Option) (asyncint64.Counter, error) {
+func (n nonrecordingAsyncInt64Instrument) Counter(string, ...instrument.Int64ObserverOption) (instrument.Int64ObservableCounter, error) {
return n, nil
}
-func (n nonrecordingAsyncInt64Instrument) UpDownCounter(string, ...instrument.Option) (asyncint64.UpDownCounter, error) {
+func (n nonrecordingAsyncInt64Instrument) UpDownCounter(string, ...instrument.Int64ObserverOption) (instrument.Int64ObservableUpDownCounter, error) {
return n, nil
}
-func (n nonrecordingAsyncInt64Instrument) Gauge(string, ...instrument.Option) (asyncint64.Gauge, error) {
+func (n nonrecordingAsyncInt64Instrument) Gauge(string, ...instrument.Int64ObserverOption) (instrument.Int64ObservableGauge, error) {
return n, nil
}
-func (nonrecordingAsyncInt64Instrument) Observe(context.Context, int64, ...attribute.KeyValue) {
-}
-
type nonrecordingSyncFloat64Instrument struct {
instrument.Synchronous
}
var (
- _ syncfloat64.InstrumentProvider = nonrecordingSyncFloat64Instrument{}
- _ syncfloat64.Counter = nonrecordingSyncFloat64Instrument{}
- _ syncfloat64.UpDownCounter = nonrecordingSyncFloat64Instrument{}
- _ syncfloat64.Histogram = nonrecordingSyncFloat64Instrument{}
+ _ instrument.Float64Counter = nonrecordingSyncFloat64Instrument{}
+ _ instrument.Float64UpDownCounter = nonrecordingSyncFloat64Instrument{}
+ _ instrument.Float64Histogram = nonrecordingSyncFloat64Instrument{}
)
-func (n nonrecordingSyncFloat64Instrument) Counter(string, ...instrument.Option) (syncfloat64.Counter, error) {
+func (n nonrecordingSyncFloat64Instrument) Counter(string, ...instrument.Float64Option) (instrument.Float64Counter, error) {
return n, nil
}
-func (n nonrecordingSyncFloat64Instrument) UpDownCounter(string, ...instrument.Option) (syncfloat64.UpDownCounter, error) {
+func (n nonrecordingSyncFloat64Instrument) UpDownCounter(string, ...instrument.Float64Option) (instrument.Float64UpDownCounter, error) {
return n, nil
}
-func (n nonrecordingSyncFloat64Instrument) Histogram(string, ...instrument.Option) (syncfloat64.Histogram, error) {
+func (n nonrecordingSyncFloat64Instrument) Histogram(string, ...instrument.Float64Option) (instrument.Float64Histogram, error) {
return n, nil
}
@@ -157,21 +175,20 @@ type nonrecordingSyncInt64Instrument struct {
}
var (
- _ syncint64.InstrumentProvider = nonrecordingSyncInt64Instrument{}
- _ syncint64.Counter = nonrecordingSyncInt64Instrument{}
- _ syncint64.UpDownCounter = nonrecordingSyncInt64Instrument{}
- _ syncint64.Histogram = nonrecordingSyncInt64Instrument{}
+ _ instrument.Int64Counter = nonrecordingSyncInt64Instrument{}
+ _ instrument.Int64UpDownCounter = nonrecordingSyncInt64Instrument{}
+ _ instrument.Int64Histogram = nonrecordingSyncInt64Instrument{}
)
-func (n nonrecordingSyncInt64Instrument) Counter(string, ...instrument.Option) (syncint64.Counter, error) {
+func (n nonrecordingSyncInt64Instrument) Counter(string, ...instrument.Int64Option) (instrument.Int64Counter, error) {
return n, nil
}
-func (n nonrecordingSyncInt64Instrument) UpDownCounter(string, ...instrument.Option) (syncint64.UpDownCounter, error) {
+func (n nonrecordingSyncInt64Instrument) UpDownCounter(string, ...instrument.Int64Option) (instrument.Int64UpDownCounter, error) {
return n, nil
}
-func (n nonrecordingSyncInt64Instrument) Histogram(string, ...instrument.Option) (syncint64.Histogram, error) {
+func (n nonrecordingSyncInt64Instrument) Histogram(string, ...instrument.Int64Option) (instrument.Int64Histogram, error) {
return n, nil
}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go b/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
deleted file mode 100644
index b580eedef..000000000
--- a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
+++ /dev/null
@@ -1,336 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package internal // import "go.opentelemetry.io/otel/semconv/internal"
-
-import (
- "fmt"
- "net"
- "net/http"
- "strconv"
- "strings"
-
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/codes"
- "go.opentelemetry.io/otel/trace"
-)
-
-// SemanticConventions are the semantic convention values defined for a
-// version of the OpenTelemetry specification.
-type SemanticConventions struct {
- EnduserIDKey attribute.Key
- HTTPClientIPKey attribute.Key
- HTTPFlavorKey attribute.Key
- HTTPHostKey attribute.Key
- HTTPMethodKey attribute.Key
- HTTPRequestContentLengthKey attribute.Key
- HTTPRouteKey attribute.Key
- HTTPSchemeHTTP attribute.KeyValue
- HTTPSchemeHTTPS attribute.KeyValue
- HTTPServerNameKey attribute.Key
- HTTPStatusCodeKey attribute.Key
- HTTPTargetKey attribute.Key
- HTTPURLKey attribute.Key
- HTTPUserAgentKey attribute.Key
- NetHostIPKey attribute.Key
- NetHostNameKey attribute.Key
- NetHostPortKey attribute.Key
- NetPeerIPKey attribute.Key
- NetPeerNameKey attribute.Key
- NetPeerPortKey attribute.Key
- NetTransportIP attribute.KeyValue
- NetTransportOther attribute.KeyValue
- NetTransportTCP attribute.KeyValue
- NetTransportUDP attribute.KeyValue
- NetTransportUnix attribute.KeyValue
-}
-
-// NetAttributesFromHTTPRequest generates attributes of the net
-// namespace as specified by the OpenTelemetry specification for a
-// span. The network parameter is a string that net.Dial function
-// from standard library can understand.
-func (sc *SemanticConventions) NetAttributesFromHTTPRequest(network string, request *http.Request) []attribute.KeyValue {
- attrs := []attribute.KeyValue{}
-
- switch network {
- case "tcp", "tcp4", "tcp6":
- attrs = append(attrs, sc.NetTransportTCP)
- case "udp", "udp4", "udp6":
- attrs = append(attrs, sc.NetTransportUDP)
- case "ip", "ip4", "ip6":
- attrs = append(attrs, sc.NetTransportIP)
- case "unix", "unixgram", "unixpacket":
- attrs = append(attrs, sc.NetTransportUnix)
- default:
- attrs = append(attrs, sc.NetTransportOther)
- }
-
- peerIP, peerName, peerPort := hostIPNamePort(request.RemoteAddr)
- if peerIP != "" {
- attrs = append(attrs, sc.NetPeerIPKey.String(peerIP))
- }
- if peerName != "" {
- attrs = append(attrs, sc.NetPeerNameKey.String(peerName))
- }
- if peerPort != 0 {
- attrs = append(attrs, sc.NetPeerPortKey.Int(peerPort))
- }
-
- hostIP, hostName, hostPort := "", "", 0
- for _, someHost := range []string{request.Host, request.Header.Get("Host"), request.URL.Host} {
- hostIP, hostName, hostPort = hostIPNamePort(someHost)
- if hostIP != "" || hostName != "" || hostPort != 0 {
- break
- }
- }
- if hostIP != "" {
- attrs = append(attrs, sc.NetHostIPKey.String(hostIP))
- }
- if hostName != "" {
- attrs = append(attrs, sc.NetHostNameKey.String(hostName))
- }
- if hostPort != 0 {
- attrs = append(attrs, sc.NetHostPortKey.Int(hostPort))
- }
-
- return attrs
-}
-
-// hostIPNamePort extracts the IP address, name and (optional) port from hostWithPort.
-// It handles both IPv4 and IPv6 addresses. If the host portion is not recognized
-// as a valid IPv4 or IPv6 address, the `ip` result will be empty and the
-// host portion will instead be returned in `name`.
-func hostIPNamePort(hostWithPort string) (ip string, name string, port int) {
- var (
- hostPart, portPart string
- parsedPort uint64
- err error
- )
- if hostPart, portPart, err = net.SplitHostPort(hostWithPort); err != nil {
- hostPart, portPart = hostWithPort, ""
- }
- if parsedIP := net.ParseIP(hostPart); parsedIP != nil {
- ip = parsedIP.String()
- } else {
- name = hostPart
- }
- if parsedPort, err = strconv.ParseUint(portPart, 10, 16); err == nil {
- port = int(parsedPort)
- }
- return
-}
-
-// EndUserAttributesFromHTTPRequest generates attributes of the
-// enduser namespace as specified by the OpenTelemetry specification
-// for a span.
-func (sc *SemanticConventions) EndUserAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue {
- if username, _, ok := request.BasicAuth(); ok {
- return []attribute.KeyValue{sc.EnduserIDKey.String(username)}
- }
- return nil
-}
-
-// HTTPClientAttributesFromHTTPRequest generates attributes of the
-// http namespace as specified by the OpenTelemetry specification for
-// a span on the client side.
-func (sc *SemanticConventions) HTTPClientAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue {
- attrs := []attribute.KeyValue{}
-
- // remove any username/password info that may be in the URL
- // before adding it to the attributes
- userinfo := request.URL.User
- request.URL.User = nil
-
- attrs = append(attrs, sc.HTTPURLKey.String(request.URL.String()))
-
- // restore any username/password info that was removed
- request.URL.User = userinfo
-
- return append(attrs, sc.httpCommonAttributesFromHTTPRequest(request)...)
-}
-
-func (sc *SemanticConventions) httpCommonAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue {
- attrs := []attribute.KeyValue{}
- if ua := request.UserAgent(); ua != "" {
- attrs = append(attrs, sc.HTTPUserAgentKey.String(ua))
- }
- if request.ContentLength > 0 {
- attrs = append(attrs, sc.HTTPRequestContentLengthKey.Int64(request.ContentLength))
- }
-
- return append(attrs, sc.httpBasicAttributesFromHTTPRequest(request)...)
-}
-
-func (sc *SemanticConventions) httpBasicAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue {
- // as these attributes are used by HTTPServerMetricAttributesFromHTTPRequest, they should be low-cardinality
- attrs := []attribute.KeyValue{}
-
- if request.TLS != nil {
- attrs = append(attrs, sc.HTTPSchemeHTTPS)
- } else {
- attrs = append(attrs, sc.HTTPSchemeHTTP)
- }
-
- if request.Host != "" {
- attrs = append(attrs, sc.HTTPHostKey.String(request.Host))
- } else if request.URL != nil && request.URL.Host != "" {
- attrs = append(attrs, sc.HTTPHostKey.String(request.URL.Host))
- }
-
- flavor := ""
- if request.ProtoMajor == 1 {
- flavor = fmt.Sprintf("1.%d", request.ProtoMinor)
- } else if request.ProtoMajor == 2 {
- flavor = "2"
- }
- if flavor != "" {
- attrs = append(attrs, sc.HTTPFlavorKey.String(flavor))
- }
-
- if request.Method != "" {
- attrs = append(attrs, sc.HTTPMethodKey.String(request.Method))
- } else {
- attrs = append(attrs, sc.HTTPMethodKey.String(http.MethodGet))
- }
-
- return attrs
-}
-
-// HTTPServerMetricAttributesFromHTTPRequest generates low-cardinality attributes
-// to be used with server-side HTTP metrics.
-func (sc *SemanticConventions) HTTPServerMetricAttributesFromHTTPRequest(serverName string, request *http.Request) []attribute.KeyValue {
- attrs := []attribute.KeyValue{}
- if serverName != "" {
- attrs = append(attrs, sc.HTTPServerNameKey.String(serverName))
- }
- return append(attrs, sc.httpBasicAttributesFromHTTPRequest(request)...)
-}
-
-// HTTPServerAttributesFromHTTPRequest generates attributes of the
-// http namespace as specified by the OpenTelemetry specification for
-// a span on the server side. Currently, only basic authentication is
-// supported.
-func (sc *SemanticConventions) HTTPServerAttributesFromHTTPRequest(serverName, route string, request *http.Request) []attribute.KeyValue {
- attrs := []attribute.KeyValue{
- sc.HTTPTargetKey.String(request.RequestURI),
- }
-
- if serverName != "" {
- attrs = append(attrs, sc.HTTPServerNameKey.String(serverName))
- }
- if route != "" {
- attrs = append(attrs, sc.HTTPRouteKey.String(route))
- }
- if values, ok := request.Header["X-Forwarded-For"]; ok && len(values) > 0 {
- if addresses := strings.SplitN(values[0], ",", 2); len(addresses) > 0 {
- attrs = append(attrs, sc.HTTPClientIPKey.String(addresses[0]))
- }
- }
-
- return append(attrs, sc.httpCommonAttributesFromHTTPRequest(request)...)
-}
-
-// HTTPAttributesFromHTTPStatusCode generates attributes of the http
-// namespace as specified by the OpenTelemetry specification for a
-// span.
-func (sc *SemanticConventions) HTTPAttributesFromHTTPStatusCode(code int) []attribute.KeyValue {
- attrs := []attribute.KeyValue{
- sc.HTTPStatusCodeKey.Int(code),
- }
- return attrs
-}
-
-type codeRange struct {
- fromInclusive int
- toInclusive int
-}
-
-func (r codeRange) contains(code int) bool {
- return r.fromInclusive <= code && code <= r.toInclusive
-}
-
-var validRangesPerCategory = map[int][]codeRange{
- 1: {
- {http.StatusContinue, http.StatusEarlyHints},
- },
- 2: {
- {http.StatusOK, http.StatusAlreadyReported},
- {http.StatusIMUsed, http.StatusIMUsed},
- },
- 3: {
- {http.StatusMultipleChoices, http.StatusUseProxy},
- {http.StatusTemporaryRedirect, http.StatusPermanentRedirect},
- },
- 4: {
- {http.StatusBadRequest, http.StatusTeapot}, // yes, teapot is so useful…
- {http.StatusMisdirectedRequest, http.StatusUpgradeRequired},
- {http.StatusPreconditionRequired, http.StatusTooManyRequests},
- {http.StatusRequestHeaderFieldsTooLarge, http.StatusRequestHeaderFieldsTooLarge},
- {http.StatusUnavailableForLegalReasons, http.StatusUnavailableForLegalReasons},
- },
- 5: {
- {http.StatusInternalServerError, http.StatusLoopDetected},
- {http.StatusNotExtended, http.StatusNetworkAuthenticationRequired},
- },
-}
-
-// SpanStatusFromHTTPStatusCode generates a status code and a message
-// as specified by the OpenTelemetry specification for a span.
-func SpanStatusFromHTTPStatusCode(code int) (codes.Code, string) {
- spanCode, valid := validateHTTPStatusCode(code)
- if !valid {
- return spanCode, fmt.Sprintf("Invalid HTTP status code %d", code)
- }
- return spanCode, ""
-}
-
-// SpanStatusFromHTTPStatusCodeAndSpanKind generates a status code and a message
-// as specified by the OpenTelemetry specification for a span.
-// Exclude 4xx for SERVER to set the appropriate status.
-func SpanStatusFromHTTPStatusCodeAndSpanKind(code int, spanKind trace.SpanKind) (codes.Code, string) {
- spanCode, valid := validateHTTPStatusCode(code)
- if !valid {
- return spanCode, fmt.Sprintf("Invalid HTTP status code %d", code)
- }
- category := code / 100
- if spanKind == trace.SpanKindServer && category == 4 {
- return codes.Unset, ""
- }
- return spanCode, ""
-}
-
-// validateHTTPStatusCode validates the HTTP status code and returns
-// corresponding span status code. If the `code` is not a valid HTTP status
-// code, returns span status Error and false.
-func validateHTTPStatusCode(code int) (codes.Code, bool) {
- category := code / 100
- ranges, ok := validRangesPerCategory[category]
- if !ok {
- return codes.Error, false
- }
- ok = false
- for _, crange := range ranges {
- ok = crange.contains(code)
- if ok {
- break
- }
- }
- if !ok {
- return codes.Error, false
- }
- if category > 0 && category < 4 {
- return codes.Unset, true
- }
- return codes.Error, true
-}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go
new file mode 100644
index 000000000..c7c47fa88
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go
@@ -0,0 +1,405 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package internal // import "go.opentelemetry.io/otel/semconv/internal/v2"
+
+import (
+ "fmt"
+ "net/http"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+)
+
+// HTTPConv are the HTTP semantic convention attributes defined for a version
+// of the OpenTelemetry specification.
+type HTTPConv struct {
+ NetConv *NetConv
+
+ EnduserIDKey attribute.Key
+ HTTPClientIPKey attribute.Key
+ HTTPFlavorKey attribute.Key
+ HTTPMethodKey attribute.Key
+ HTTPRequestContentLengthKey attribute.Key
+ HTTPResponseContentLengthKey attribute.Key
+ HTTPRouteKey attribute.Key
+ HTTPSchemeHTTP attribute.KeyValue
+ HTTPSchemeHTTPS attribute.KeyValue
+ HTTPStatusCodeKey attribute.Key
+ HTTPTargetKey attribute.Key
+ HTTPURLKey attribute.Key
+ HTTPUserAgentKey attribute.Key
+}
+
+// ClientResponse returns attributes for an HTTP response received by a client
+// from a server. The following attributes are returned if the related values
+// are defined in resp: "http.status.code", "http.response_content_length".
+//
+// This does not add all OpenTelemetry required attributes for an HTTP event,
+// it assumes ClientRequest was used to create the span with a complete set of
+// attributes. If a complete set of attributes can be generated using the
+// request contained in resp. For example:
+//
+// append(ClientResponse(resp), ClientRequest(resp.Request)...)
+func (c *HTTPConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
+ var n int
+ if resp.StatusCode > 0 {
+ n++
+ }
+ if resp.ContentLength > 0 {
+ n++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, n)
+ if resp.StatusCode > 0 {
+ attrs = append(attrs, c.HTTPStatusCodeKey.Int(resp.StatusCode))
+ }
+ if resp.ContentLength > 0 {
+ attrs = append(attrs, c.HTTPResponseContentLengthKey.Int(int(resp.ContentLength)))
+ }
+ return attrs
+}
+
+// ClientRequest returns attributes for an HTTP request made by a client. The
+// following attributes are always returned: "http.url", "http.flavor",
+// "http.method", "net.peer.name". The following attributes are returned if the
+// related values are defined in req: "net.peer.port", "http.user_agent",
+// "http.request_content_length", "enduser.id".
+func (c *HTTPConv) ClientRequest(req *http.Request) []attribute.KeyValue {
+ n := 3 // URL, peer name, proto, and method.
+ var h string
+ if req.URL != nil {
+ h = req.URL.Host
+ }
+ peer, p := firstHostPort(h, req.Header.Get("Host"))
+ port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", p)
+ if port > 0 {
+ n++
+ }
+ useragent := req.UserAgent()
+ if useragent != "" {
+ n++
+ }
+ if req.ContentLength > 0 {
+ n++
+ }
+ userID, _, hasUserID := req.BasicAuth()
+ if hasUserID {
+ n++
+ }
+ attrs := make([]attribute.KeyValue, 0, n)
+
+ attrs = append(attrs, c.method(req.Method))
+ attrs = append(attrs, c.proto(req.Proto))
+
+ var u string
+ if req.URL != nil {
+ // Remove any username/password info that may be in the URL.
+ userinfo := req.URL.User
+ req.URL.User = nil
+ u = req.URL.String()
+ // Restore any username/password info that was removed.
+ req.URL.User = userinfo
+ }
+ attrs = append(attrs, c.HTTPURLKey.String(u))
+
+ attrs = append(attrs, c.NetConv.PeerName(peer))
+ if port > 0 {
+ attrs = append(attrs, c.NetConv.PeerPort(port))
+ }
+
+ if useragent != "" {
+ attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
+ }
+
+ if l := req.ContentLength; l > 0 {
+ attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l))
+ }
+
+ if hasUserID {
+ attrs = append(attrs, c.EnduserIDKey.String(userID))
+ }
+
+ return attrs
+}
+
+// ServerRequest returns attributes for an HTTP request received by a server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+//
+// The following attributes are always returned: "http.method", "http.scheme",
+// "http.flavor", "http.target", "net.host.name". The following attributes are
+// returned if they related values are defined in req: "net.host.port",
+// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
+// "http.client_ip".
+func (c *HTTPConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue {
+ n := 5 // Method, scheme, target, proto, and host name.
+ var host string
+ var p int
+ if server == "" {
+ host, p = splitHostPort(req.Host)
+ } else {
+ // Prioritize the primary server name.
+ host, p = splitHostPort(server)
+ if p < 0 {
+ _, p = splitHostPort(req.Host)
+ }
+ }
+ hostPort := requiredHTTPPort(req.TLS != nil, p)
+ if hostPort > 0 {
+ n++
+ }
+ peer, peerPort := splitHostPort(req.RemoteAddr)
+ if peer != "" {
+ n++
+ if peerPort > 0 {
+ n++
+ }
+ }
+ useragent := req.UserAgent()
+ if useragent != "" {
+ n++
+ }
+ userID, _, hasUserID := req.BasicAuth()
+ if hasUserID {
+ n++
+ }
+ clientIP := serverClientIP(req.Header.Get("X-Forwarded-For"))
+ if clientIP != "" {
+ n++
+ }
+ attrs := make([]attribute.KeyValue, 0, n)
+
+ attrs = append(attrs, c.method(req.Method))
+ attrs = append(attrs, c.scheme(req.TLS != nil))
+ attrs = append(attrs, c.proto(req.Proto))
+ attrs = append(attrs, c.NetConv.HostName(host))
+
+ if req.URL != nil {
+ attrs = append(attrs, c.HTTPTargetKey.String(req.URL.RequestURI()))
+ } else {
+ // This should never occur if the request was generated by the net/http
+ // package. Fail gracefully, if it does though.
+ attrs = append(attrs, c.HTTPTargetKey.String(req.RequestURI))
+ }
+
+ if hostPort > 0 {
+ attrs = append(attrs, c.NetConv.HostPort(hostPort))
+ }
+
+ if peer != "" {
+ // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a
+ // file-path that would be interpreted with a sock family.
+ attrs = append(attrs, c.NetConv.SockPeerAddr(peer))
+ if peerPort > 0 {
+ attrs = append(attrs, c.NetConv.SockPeerPort(peerPort))
+ }
+ }
+
+ if useragent != "" {
+ attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
+ }
+
+ if hasUserID {
+ attrs = append(attrs, c.EnduserIDKey.String(userID))
+ }
+
+ if clientIP != "" {
+ attrs = append(attrs, c.HTTPClientIPKey.String(clientIP))
+ }
+
+ return attrs
+}
+
+func (c *HTTPConv) method(method string) attribute.KeyValue {
+ if method == "" {
+ return c.HTTPMethodKey.String(http.MethodGet)
+ }
+ return c.HTTPMethodKey.String(method)
+}
+
+func (c *HTTPConv) scheme(https bool) attribute.KeyValue { // nolint:revive
+ if https {
+ return c.HTTPSchemeHTTPS
+ }
+ return c.HTTPSchemeHTTP
+}
+
+func (c *HTTPConv) proto(proto string) attribute.KeyValue {
+ switch proto {
+ case "HTTP/1.0":
+ return c.HTTPFlavorKey.String("1.0")
+ case "HTTP/1.1":
+ return c.HTTPFlavorKey.String("1.1")
+ case "HTTP/2":
+ return c.HTTPFlavorKey.String("2.0")
+ case "HTTP/3":
+ return c.HTTPFlavorKey.String("3.0")
+ default:
+ return c.HTTPFlavorKey.String(proto)
+ }
+}
+
+func serverClientIP(xForwardedFor string) string {
+ if idx := strings.Index(xForwardedFor, ","); idx >= 0 {
+ xForwardedFor = xForwardedFor[:idx]
+ }
+ return xForwardedFor
+}
+
+func requiredHTTPPort(https bool, port int) int { // nolint:revive
+ if https {
+ if port > 0 && port != 443 {
+ return port
+ }
+ } else {
+ if port > 0 && port != 80 {
+ return port
+ }
+ }
+ return -1
+}
+
+// Return the request host and port from the first non-empty source.
+func firstHostPort(source ...string) (host string, port int) {
+ for _, hostport := range source {
+ host, port = splitHostPort(hostport)
+ if host != "" || port > 0 {
+ break
+ }
+ }
+ return
+}
+
+// RequestHeader returns the contents of h as OpenTelemetry attributes.
+func (c *HTTPConv) RequestHeader(h http.Header) []attribute.KeyValue {
+ return c.header("http.request.header", h)
+}
+
+// ResponseHeader returns the contents of h as OpenTelemetry attributes.
+func (c *HTTPConv) ResponseHeader(h http.Header) []attribute.KeyValue {
+ return c.header("http.response.header", h)
+}
+
+func (c *HTTPConv) header(prefix string, h http.Header) []attribute.KeyValue {
+ key := func(k string) attribute.Key {
+ k = strings.ToLower(k)
+ k = strings.ReplaceAll(k, "-", "_")
+ k = fmt.Sprintf("%s.%s", prefix, k)
+ return attribute.Key(k)
+ }
+
+ attrs := make([]attribute.KeyValue, 0, len(h))
+ for k, v := range h {
+ attrs = append(attrs, key(k).StringSlice(v))
+ }
+ return attrs
+}
+
+// ClientStatus returns a span status code and message for an HTTP status code
+// value received by a client.
+func (c *HTTPConv) ClientStatus(code int) (codes.Code, string) {
+ stat, valid := validateHTTPStatusCode(code)
+ if !valid {
+ return stat, fmt.Sprintf("Invalid HTTP status code %d", code)
+ }
+ return stat, ""
+}
+
+// ServerStatus returns a span status code and message for an HTTP status code
+// value returned by a server. Status codes in the 400-499 range are not
+// returned as errors.
+func (c *HTTPConv) ServerStatus(code int) (codes.Code, string) {
+ stat, valid := validateHTTPStatusCode(code)
+ if !valid {
+ return stat, fmt.Sprintf("Invalid HTTP status code %d", code)
+ }
+
+ if code/100 == 4 {
+ return codes.Unset, ""
+ }
+ return stat, ""
+}
+
+type codeRange struct {
+ fromInclusive int
+ toInclusive int
+}
+
+func (r codeRange) contains(code int) bool {
+ return r.fromInclusive <= code && code <= r.toInclusive
+}
+
+var validRangesPerCategory = map[int][]codeRange{
+ 1: {
+ {http.StatusContinue, http.StatusEarlyHints},
+ },
+ 2: {
+ {http.StatusOK, http.StatusAlreadyReported},
+ {http.StatusIMUsed, http.StatusIMUsed},
+ },
+ 3: {
+ {http.StatusMultipleChoices, http.StatusUseProxy},
+ {http.StatusTemporaryRedirect, http.StatusPermanentRedirect},
+ },
+ 4: {
+ {http.StatusBadRequest, http.StatusTeapot}, // yes, teapot is so useful…
+ {http.StatusMisdirectedRequest, http.StatusUpgradeRequired},
+ {http.StatusPreconditionRequired, http.StatusTooManyRequests},
+ {http.StatusRequestHeaderFieldsTooLarge, http.StatusRequestHeaderFieldsTooLarge},
+ {http.StatusUnavailableForLegalReasons, http.StatusUnavailableForLegalReasons},
+ },
+ 5: {
+ {http.StatusInternalServerError, http.StatusLoopDetected},
+ {http.StatusNotExtended, http.StatusNetworkAuthenticationRequired},
+ },
+}
+
+// validateHTTPStatusCode validates the HTTP status code and returns
+// corresponding span status code. If the `code` is not a valid HTTP status
+// code, returns span status Error and false.
+func validateHTTPStatusCode(code int) (codes.Code, bool) {
+ category := code / 100
+ ranges, ok := validRangesPerCategory[category]
+ if !ok {
+ return codes.Error, false
+ }
+ ok = false
+ for _, crange := range ranges {
+ ok = crange.contains(code)
+ if ok {
+ break
+ }
+ }
+ if !ok {
+ return codes.Error, false
+ }
+ if category > 0 && category < 4 {
+ return codes.Unset, true
+ }
+ return codes.Error, true
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go
new file mode 100644
index 000000000..4a711133a
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go
@@ -0,0 +1,324 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package internal // import "go.opentelemetry.io/otel/semconv/internal/v2"
+
+import (
+ "net"
+ "strconv"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+)
+
+// NetConv are the network semantic convention attributes defined for a version
+// of the OpenTelemetry specification.
+type NetConv struct {
+ NetHostNameKey attribute.Key
+ NetHostPortKey attribute.Key
+ NetPeerNameKey attribute.Key
+ NetPeerPortKey attribute.Key
+ NetSockFamilyKey attribute.Key
+ NetSockPeerAddrKey attribute.Key
+ NetSockPeerPortKey attribute.Key
+ NetSockHostAddrKey attribute.Key
+ NetSockHostPortKey attribute.Key
+ NetTransportOther attribute.KeyValue
+ NetTransportTCP attribute.KeyValue
+ NetTransportUDP attribute.KeyValue
+ NetTransportInProc attribute.KeyValue
+}
+
+func (c *NetConv) Transport(network string) attribute.KeyValue {
+ switch network {
+ case "tcp", "tcp4", "tcp6":
+ return c.NetTransportTCP
+ case "udp", "udp4", "udp6":
+ return c.NetTransportUDP
+ case "unix", "unixgram", "unixpacket":
+ return c.NetTransportInProc
+ default:
+ // "ip:*", "ip4:*", and "ip6:*" all are considered other.
+ return c.NetTransportOther
+ }
+}
+
+// Host returns attributes for a network host address.
+func (c *NetConv) Host(address string) []attribute.KeyValue {
+ h, p := splitHostPort(address)
+ var n int
+ if h != "" {
+ n++
+ if p > 0 {
+ n++
+ }
+ }
+
+ if n == 0 {
+ return nil
+ }
+
+ attrs := make([]attribute.KeyValue, 0, n)
+ attrs = append(attrs, c.HostName(h))
+ if p > 0 {
+ attrs = append(attrs, c.HostPort(int(p)))
+ }
+ return attrs
+}
+
+// Server returns attributes for a network listener listening at address. See
+// net.Listen for information about acceptable address values, address should
+// be the same as the one used to create ln. If ln is nil, only network host
+// attributes will be returned that describe address. Otherwise, the socket
+// level information about ln will also be included.
+func (c *NetConv) Server(address string, ln net.Listener) []attribute.KeyValue {
+ if ln == nil {
+ return c.Host(address)
+ }
+
+ lAddr := ln.Addr()
+ if lAddr == nil {
+ return c.Host(address)
+ }
+
+ hostName, hostPort := splitHostPort(address)
+ sockHostAddr, sockHostPort := splitHostPort(lAddr.String())
+ network := lAddr.Network()
+ sockFamily := family(network, sockHostAddr)
+
+ n := nonZeroStr(hostName, network, sockHostAddr, sockFamily)
+ n += positiveInt(hostPort, sockHostPort)
+ attr := make([]attribute.KeyValue, 0, n)
+ if hostName != "" {
+ attr = append(attr, c.HostName(hostName))
+ if hostPort > 0 {
+ // Only if net.host.name is set should net.host.port be.
+ attr = append(attr, c.HostPort(hostPort))
+ }
+ }
+ if network != "" {
+ attr = append(attr, c.Transport(network))
+ }
+ if sockFamily != "" {
+ attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
+ }
+ if sockHostAddr != "" {
+ attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
+ if sockHostPort > 0 {
+ // Only if net.sock.host.addr is set should net.sock.host.port be.
+ attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
+ }
+ }
+ return attr
+}
+
+func (c *NetConv) HostName(name string) attribute.KeyValue {
+ return c.NetHostNameKey.String(name)
+}
+
+func (c *NetConv) HostPort(port int) attribute.KeyValue {
+ return c.NetHostPortKey.Int(port)
+}
+
+// Client returns attributes for a client network connection to address. See
+// net.Dial for information about acceptable address values, address should be
+// the same as the one used to create conn. If conn is nil, only network peer
+// attributes will be returned that describe address. Otherwise, the socket
+// level information about conn will also be included.
+func (c *NetConv) Client(address string, conn net.Conn) []attribute.KeyValue {
+ if conn == nil {
+ return c.Peer(address)
+ }
+
+ lAddr, rAddr := conn.LocalAddr(), conn.RemoteAddr()
+
+ var network string
+ switch {
+ case lAddr != nil:
+ network = lAddr.Network()
+ case rAddr != nil:
+ network = rAddr.Network()
+ default:
+ return c.Peer(address)
+ }
+
+ peerName, peerPort := splitHostPort(address)
+ var (
+ sockFamily string
+ sockPeerAddr string
+ sockPeerPort int
+ sockHostAddr string
+ sockHostPort int
+ )
+
+ if lAddr != nil {
+ sockHostAddr, sockHostPort = splitHostPort(lAddr.String())
+ }
+
+ if rAddr != nil {
+ sockPeerAddr, sockPeerPort = splitHostPort(rAddr.String())
+ }
+
+ switch {
+ case sockHostAddr != "":
+ sockFamily = family(network, sockHostAddr)
+ case sockPeerAddr != "":
+ sockFamily = family(network, sockPeerAddr)
+ }
+
+ n := nonZeroStr(peerName, network, sockPeerAddr, sockHostAddr, sockFamily)
+ n += positiveInt(peerPort, sockPeerPort, sockHostPort)
+ attr := make([]attribute.KeyValue, 0, n)
+ if peerName != "" {
+ attr = append(attr, c.PeerName(peerName))
+ if peerPort > 0 {
+ // Only if net.peer.name is set should net.peer.port be.
+ attr = append(attr, c.PeerPort(peerPort))
+ }
+ }
+ if network != "" {
+ attr = append(attr, c.Transport(network))
+ }
+ if sockFamily != "" {
+ attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
+ }
+ if sockPeerAddr != "" {
+ attr = append(attr, c.NetSockPeerAddrKey.String(sockPeerAddr))
+ if sockPeerPort > 0 {
+ // Only if net.sock.peer.addr is set should net.sock.peer.port be.
+ attr = append(attr, c.NetSockPeerPortKey.Int(sockPeerPort))
+ }
+ }
+ if sockHostAddr != "" {
+ attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
+ if sockHostPort > 0 {
+ // Only if net.sock.host.addr is set should net.sock.host.port be.
+ attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
+ }
+ }
+ return attr
+}
+
+func family(network, address string) string {
+ switch network {
+ case "unix", "unixgram", "unixpacket":
+ return "unix"
+ default:
+ if ip := net.ParseIP(address); ip != nil {
+ if ip.To4() == nil {
+ return "inet6"
+ }
+ return "inet"
+ }
+ }
+ return ""
+}
+
+func nonZeroStr(strs ...string) int {
+ var n int
+ for _, str := range strs {
+ if str != "" {
+ n++
+ }
+ }
+ return n
+}
+
+func positiveInt(ints ...int) int {
+ var n int
+ for _, i := range ints {
+ if i > 0 {
+ n++
+ }
+ }
+ return n
+}
+
+// Peer returns attributes for a network peer address.
+func (c *NetConv) Peer(address string) []attribute.KeyValue {
+ h, p := splitHostPort(address)
+ var n int
+ if h != "" {
+ n++
+ if p > 0 {
+ n++
+ }
+ }
+
+ if n == 0 {
+ return nil
+ }
+
+ attrs := make([]attribute.KeyValue, 0, n)
+ attrs = append(attrs, c.PeerName(h))
+ if p > 0 {
+ attrs = append(attrs, c.PeerPort(int(p)))
+ }
+ return attrs
+}
+
+func (c *NetConv) PeerName(name string) attribute.KeyValue {
+ return c.NetPeerNameKey.String(name)
+}
+
+func (c *NetConv) PeerPort(port int) attribute.KeyValue {
+ return c.NetPeerPortKey.Int(port)
+}
+
+func (c *NetConv) SockPeerAddr(addr string) attribute.KeyValue {
+ return c.NetSockPeerAddrKey.String(addr)
+}
+
+func (c *NetConv) SockPeerPort(port int) attribute.KeyValue {
+ return c.NetSockPeerPortKey.Int(port)
+}
+
+// splitHostPort splits a network address hostport of the form "host",
+// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port",
+// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and
+// port.
+//
+// An empty host is returned if it is not provided or unparsable. A negative
+// port is returned if it is not provided or unparsable.
+func splitHostPort(hostport string) (host string, port int) {
+ port = -1
+
+ if strings.HasPrefix(hostport, "[") {
+ addrEnd := strings.LastIndex(hostport, "]")
+ if addrEnd < 0 {
+ // Invalid hostport.
+ return
+ }
+ if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
+ host = hostport[1:addrEnd]
+ return
+ }
+ } else {
+ if i := strings.LastIndex(hostport, ":"); i < 0 {
+ host = hostport
+ return
+ }
+ }
+
+ host, pStr, err := net.SplitHostPort(hostport)
+ if err != nil {
+ return
+ }
+
+ p, err := strconv.ParseUint(pStr, 10, 16)
+ if err != nil {
+ return
+ }
+ return host, int(p)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
deleted file mode 100644
index 4b4f3cbaf..000000000
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
-
-import (
- "net/http"
-
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/codes"
- "go.opentelemetry.io/otel/semconv/internal"
- "go.opentelemetry.io/otel/trace"
-)
-
-// HTTP scheme attributes.
-var (
- HTTPSchemeHTTP = HTTPSchemeKey.String("http")
- HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
-)
-
-var sc = &internal.SemanticConventions{
- EnduserIDKey: EnduserIDKey,
- HTTPClientIPKey: HTTPClientIPKey,
- HTTPFlavorKey: HTTPFlavorKey,
- HTTPHostKey: HTTPHostKey,
- HTTPMethodKey: HTTPMethodKey,
- HTTPRequestContentLengthKey: HTTPRequestContentLengthKey,
- HTTPRouteKey: HTTPRouteKey,
- HTTPSchemeHTTP: HTTPSchemeHTTP,
- HTTPSchemeHTTPS: HTTPSchemeHTTPS,
- HTTPServerNameKey: HTTPServerNameKey,
- HTTPStatusCodeKey: HTTPStatusCodeKey,
- HTTPTargetKey: HTTPTargetKey,
- HTTPURLKey: HTTPURLKey,
- HTTPUserAgentKey: HTTPUserAgentKey,
- NetHostIPKey: NetHostIPKey,
- NetHostNameKey: NetHostNameKey,
- NetHostPortKey: NetHostPortKey,
- NetPeerIPKey: NetPeerIPKey,
- NetPeerNameKey: NetPeerNameKey,
- NetPeerPortKey: NetPeerPortKey,
- NetTransportIP: NetTransportIP,
- NetTransportOther: NetTransportOther,
- NetTransportTCP: NetTransportTCP,
- NetTransportUDP: NetTransportUDP,
- NetTransportUnix: NetTransportUnix,
-}
-
-// NetAttributesFromHTTPRequest generates attributes of the net
-// namespace as specified by the OpenTelemetry specification for a
-// span. The network parameter is a string that net.Dial function
-// from standard library can understand.
-func NetAttributesFromHTTPRequest(network string, request *http.Request) []attribute.KeyValue {
- return sc.NetAttributesFromHTTPRequest(network, request)
-}
-
-// EndUserAttributesFromHTTPRequest generates attributes of the
-// enduser namespace as specified by the OpenTelemetry specification
-// for a span.
-func EndUserAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue {
- return sc.EndUserAttributesFromHTTPRequest(request)
-}
-
-// HTTPClientAttributesFromHTTPRequest generates attributes of the
-// http namespace as specified by the OpenTelemetry specification for
-// a span on the client side.
-func HTTPClientAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue {
- return sc.HTTPClientAttributesFromHTTPRequest(request)
-}
-
-// HTTPServerMetricAttributesFromHTTPRequest generates low-cardinality attributes
-// to be used with server-side HTTP metrics.
-func HTTPServerMetricAttributesFromHTTPRequest(serverName string, request *http.Request) []attribute.KeyValue {
- return sc.HTTPServerMetricAttributesFromHTTPRequest(serverName, request)
-}
-
-// HTTPServerAttributesFromHTTPRequest generates attributes of the
-// http namespace as specified by the OpenTelemetry specification for
-// a span on the server side. Currently, only basic authentication is
-// supported.
-func HTTPServerAttributesFromHTTPRequest(serverName, route string, request *http.Request) []attribute.KeyValue {
- return sc.HTTPServerAttributesFromHTTPRequest(serverName, route, request)
-}
-
-// HTTPAttributesFromHTTPStatusCode generates attributes of the http
-// namespace as specified by the OpenTelemetry specification for a
-// span.
-func HTTPAttributesFromHTTPStatusCode(code int) []attribute.KeyValue {
- return sc.HTTPAttributesFromHTTPStatusCode(code)
-}
-
-// SpanStatusFromHTTPStatusCode generates a status code and a message
-// as specified by the OpenTelemetry specification for a span.
-func SpanStatusFromHTTPStatusCode(code int) (codes.Code, string) {
- return internal.SpanStatusFromHTTPStatusCode(code)
-}
-
-// SpanStatusFromHTTPStatusCodeAndSpanKind generates a status code and a message
-// as specified by the OpenTelemetry specification for a span.
-// Exclude 4xx for SERVER to set the appropriate status.
-func SpanStatusFromHTTPStatusCodeAndSpanKind(code int, spanKind trace.SpanKind) (codes.Code, string) {
- return internal.SpanStatusFromHTTPStatusCodeAndSpanKind(code, spanKind)
-}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
similarity index 92%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
index 181fcc9c5..71a1f7748 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
@@ -16,5 +16,5 @@
//
// OpenTelemetry semantic conventions are agreed standardized naming
// patterns for OpenTelemetry things. This package represents the conventions
-// as of the v1.12.0 version of the OpenTelemetry specification.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
+// as of the v1.17.0 version of the OpenTelemetry specification.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
similarity index 99%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
index d68927094..9b8c559de 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
const (
// ExceptionEventName is the name of the Span event representing an exception.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
new file mode 100644
index 000000000..d5c4b5c13
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
@@ -0,0 +1,21 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
+
+// HTTP scheme attributes.
+var (
+ HTTPSchemeHTTP = HTTPSchemeKey.String("http")
+ HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go
new file mode 100644
index 000000000..c60b2a6bb
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go
@@ -0,0 +1,150 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package httpconv provides OpenTelemetry semantic convetions for the net/http
+// package from the standard library.
+package httpconv // import "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv"
+
+import (
+ "net/http"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/semconv/internal/v2"
+ semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+)
+
+var (
+ nc = &internal.NetConv{
+ NetHostNameKey: semconv.NetHostNameKey,
+ NetHostPortKey: semconv.NetHostPortKey,
+ NetPeerNameKey: semconv.NetPeerNameKey,
+ NetPeerPortKey: semconv.NetPeerPortKey,
+ NetSockPeerAddrKey: semconv.NetSockPeerAddrKey,
+ NetSockPeerPortKey: semconv.NetSockPeerPortKey,
+ NetTransportOther: semconv.NetTransportOther,
+ NetTransportTCP: semconv.NetTransportTCP,
+ NetTransportUDP: semconv.NetTransportUDP,
+ NetTransportInProc: semconv.NetTransportInProc,
+ }
+
+ hc = &internal.HTTPConv{
+ NetConv: nc,
+
+ EnduserIDKey: semconv.EnduserIDKey,
+ HTTPClientIPKey: semconv.HTTPClientIPKey,
+ HTTPFlavorKey: semconv.HTTPFlavorKey,
+ HTTPMethodKey: semconv.HTTPMethodKey,
+ HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey,
+ HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey,
+ HTTPRouteKey: semconv.HTTPRouteKey,
+ HTTPSchemeHTTP: semconv.HTTPSchemeHTTP,
+ HTTPSchemeHTTPS: semconv.HTTPSchemeHTTPS,
+ HTTPStatusCodeKey: semconv.HTTPStatusCodeKey,
+ HTTPTargetKey: semconv.HTTPTargetKey,
+ HTTPURLKey: semconv.HTTPURLKey,
+ HTTPUserAgentKey: semconv.HTTPUserAgentKey,
+ }
+)
+
+// ClientResponse returns attributes for an HTTP response received by a client
+// from a server. It will return the following attributes if the related values
+// are defined in resp: "http.status.code", "http.response_content_length".
+//
+// This does not add all OpenTelemetry required attributes for an HTTP event,
+// it assumes ClientRequest was used to create the span with a complete set of
+// attributes. If a complete set of attributes can be generated using the
+// request contained in resp. For example:
+//
+// append(ClientResponse(resp), ClientRequest(resp.Request)...)
+func ClientResponse(resp *http.Response) []attribute.KeyValue {
+ return hc.ClientResponse(resp)
+}
+
+// ClientRequest returns attributes for an HTTP request made by a client. The
+// following attributes are always returned: "http.url", "http.flavor",
+// "http.method", "net.peer.name". The following attributes are returned if the
+// related values are defined in req: "net.peer.port", "http.user_agent",
+// "http.request_content_length", "enduser.id".
+func ClientRequest(req *http.Request) []attribute.KeyValue {
+ return hc.ClientRequest(req)
+}
+
+// ClientStatus returns a span status code and message for an HTTP status code
+// value received by a client.
+func ClientStatus(code int) (codes.Code, string) {
+ return hc.ClientStatus(code)
+}
+
+// ServerRequest returns attributes for an HTTP request received by a server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+//
+// The following attributes are always returned: "http.method", "http.scheme",
+// "http.flavor", "http.target", "net.host.name". The following attributes are
+// returned if they related values are defined in req: "net.host.port",
+// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
+// "http.client_ip".
+func ServerRequest(server string, req *http.Request) []attribute.KeyValue {
+ return hc.ServerRequest(server, req)
+}
+
+// ServerStatus returns a span status code and message for an HTTP status code
+// value returned by a server. Status codes in the 400-499 range are not
+// returned as errors.
+func ServerStatus(code int) (codes.Code, string) {
+ return hc.ServerStatus(code)
+}
+
+// RequestHeader returns the contents of h as attributes.
+//
+// Instrumentation should require an explicit configuration of which headers to
+// captured and then prune what they pass here. Including all headers can be a
+// security risk - explicit configuration helps avoid leaking sensitive
+// information.
+//
+// The User-Agent header is already captured in the http.user_agent attribute
+// from ClientRequest and ServerRequest. Instrumentation may provide an option
+// to capture that header here even though it is not recommended. Otherwise,
+// instrumentation should filter that out of what is passed.
+func RequestHeader(h http.Header) []attribute.KeyValue {
+ return hc.RequestHeader(h)
+}
+
+// ResponseHeader returns the contents of h as attributes.
+//
+// Instrumentation should require an explicit configuration of which headers to
+// captured and then prune what they pass here. Including all headers can be a
+// security risk - explicit configuration helps avoid leaking sensitive
+// information.
+//
+// The User-Agent header is already captured in the http.user_agent attribute
+// from ClientRequest and ServerRequest. Instrumentation may provide an option
+// to capture that header here even though it is not recommended. Otherwise,
+// instrumentation should filter that out of what is passed.
+func ResponseHeader(h http.Header) []attribute.KeyValue {
+ return hc.ResponseHeader(h)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
similarity index 84%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
index b2155676f..add7987a2 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
@@ -14,7 +14,7 @@
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
import "go.opentelemetry.io/otel/attribute"
@@ -23,35 +23,45 @@ const (
// Array of brand name and version separated by a space
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99'
// Note: This value is intended to be taken from the [UA client hints
// API](https://wicg.github.io/ua-client-hints/#interface)
- // (navigator.userAgentData.brands).
+ // (`navigator.userAgentData.brands`).
BrowserBrandsKey = attribute.Key("browser.brands")
// The platform on which the browser is running
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Windows', 'macOS', 'Android'
// Note: This value is intended to be taken from the [UA client hints
// API](https://wicg.github.io/ua-client-hints/#interface)
- // (navigator.userAgentData.platform). If unavailable, the legacy
+ // (`navigator.userAgentData.platform`). If unavailable, the legacy
// `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD
// be left unset in order for the values to be consistent.
// The list of possible values is defined in the [W3C User-Agent Client Hints
// specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
// Note that some (but not all) of these values can overlap with values in the
- // [os.type and os.name attributes](./os.md). However, for consistency, the values
- // in the `browser.platform` attribute should capture the exact value that the
- // user agent provides.
+ // [`os.type` and `os.name` attributes](./os.md). However, for consistency, the
+ // values in the `browser.platform` attribute should capture the exact value that
+ // the user agent provides.
BrowserPlatformKey = attribute.Key("browser.platform")
+ // A boolean that is true if the browser is running on a mobile device
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.mobile`). If unavailable, this attribute SHOULD be
+ // left unset.
+ BrowserMobileKey = attribute.Key("browser.mobile")
// Full user-agent string provided by the browser
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
// (KHTML, '
@@ -61,6 +71,15 @@ const (
// Agent Client Hints API. To retrieve the value, the legacy `navigator.userAgent`
// API can be used.
BrowserUserAgentKey = attribute.Key("browser.user_agent")
+ // Preferred language of the user using the browser
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'en', 'en-US', 'fr', 'fr-FR'
+ // Note: This value is intended to be taken from the Navigator API
+ // `navigator.language`.
+ BrowserLanguageKey = attribute.Key("browser.language")
)
// A cloud environment (e.g. GCP, Azure, AWS)
@@ -68,20 +87,20 @@ const (
// Name of the cloud provider.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
CloudProviderKey = attribute.Key("cloud.provider")
// The cloud account ID the resource is assigned to.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '111111111111', 'opentelemetry'
CloudAccountIDKey = attribute.Key("cloud.account.id")
// The geographical region the resource is running.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'us-central1', 'us-east-1'
// Note: Refer to your provider's docs to see the available regions, for example
@@ -97,7 +116,7 @@ const (
// is running.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'us-east-1c'
// Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
@@ -105,7 +124,7 @@ const (
// The cloud platform in use.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Note: The prefix of the service SHOULD match the one specified in
// `cloud.provider`.
@@ -121,6 +140,8 @@ var (
CloudProviderAzure = CloudProviderKey.String("azure")
// Google Cloud Platform
CloudProviderGCP = CloudProviderKey.String("gcp")
+ // IBM Cloud
+ CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
// Tencent Cloud
CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
)
@@ -130,6 +151,8 @@ var (
CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
// Alibaba Cloud Function Compute
CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc")
+ // Red Hat OpenShift on Alibaba Cloud
+ CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift")
// AWS Elastic Compute Cloud
CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
// AWS Elastic Container Service
@@ -142,6 +165,8 @@ var (
CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
// AWS App Runner
CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
+ // Red Hat OpenShift on AWS (ROSA)
+ CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift")
// Azure Virtual Machines
CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm")
// Azure Container Instances
@@ -152,6 +177,8 @@ var (
CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions")
// Azure App Service
CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
+ // Azure Red Hat OpenShift
+ CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
// Google Cloud Compute Engine (GCE)
CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
// Google Cloud Run
@@ -162,6 +189,10 @@ var (
CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
// Google Cloud App Engine (GAE)
CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
+ // Red Hat OpenShift on Google Cloud
+ CloudPlatformGoogleCloudOpenshift = CloudPlatformKey.String("google_cloud_openshift")
+ // Red Hat OpenShift on IBM Cloud
+ CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
// Tencent Cloud Cloud Virtual Machine (CVM)
CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm")
// Tencent Cloud Elastic Kubernetes Service (EKS)
@@ -176,7 +207,7 @@ const (
// amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:ecs:us-
// west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'
@@ -185,7 +216,7 @@ const (
// perguide/clusters.html).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
@@ -193,14 +224,14 @@ const (
// aunch_types.html) for an ECS task.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
// The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/lates
// t/developerguide/task_definitions.html).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:ecs:us-
// west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b'
@@ -208,14 +239,14 @@ const (
// The task definition family this task definition is a member of.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry-family'
AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
// The revision for this task definition.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '8', '26'
AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
@@ -233,7 +264,7 @@ const (
// The ARN of an EKS cluster.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
@@ -244,7 +275,7 @@ const (
// The name(s) of the AWS log group(s) an application is writing to.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '/aws/lambda/my-function', 'opentelemetry-service'
// Note: Multiple log groups must be supported for cases like multi-container
@@ -254,7 +285,7 @@ const (
// The Amazon Resource Name(s) (ARN) of the AWS log group(s).
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'
// Note: See the [log group ARN format
@@ -264,14 +295,14 @@ const (
// The name(s) of the AWS log stream(s) an application is writing to.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
// The ARN(s) of the AWS log stream(s).
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-
// stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
@@ -288,7 +319,7 @@ const (
// Container name used by container runtime.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry-autoconf'
ContainerNameKey = attribute.Key("container.name")
@@ -297,28 +328,28 @@ const (
// identification). The UUID might be abbreviated.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'a3bf90e006b2'
ContainerIDKey = attribute.Key("container.id")
// The container runtime managing this container.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'docker', 'containerd', 'rkt'
ContainerRuntimeKey = attribute.Key("container.runtime")
// Name of the image the container was built on.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'gcr.io/opentelemetry/operator'
ContainerImageNameKey = attribute.Key("container.image.name")
// Container image tag.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '0.1'
ContainerImageTagKey = attribute.Key("container.image.tag")
@@ -331,7 +362,7 @@ const (
// deployment tier).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'staging', 'production'
DeploymentEnvironmentKey = attribute.Key("deployment.environment")
@@ -342,7 +373,7 @@ const (
// A unique identifier representing the device
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092'
// Note: The device identifier MUST only be defined using the values outlined
@@ -360,7 +391,7 @@ const (
// The model identifier for the device
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'iPhone3,4', 'SM-G920F'
// Note: It's recommended this value represents a machine readable version of the
@@ -370,7 +401,7 @@ const (
// The marketing name for the device model
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6'
// Note: It's recommended this value represents a human readable version of the
@@ -379,7 +410,7 @@ const (
// The name of the device manufacturer
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Apple', 'Samsung'
// Note: The Android OS provides this field via
@@ -393,7 +424,7 @@ const (
// The name of the single function that this runtime instance executes.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'my-function', 'myazurefunctionapp/some-function-name'
// Note: This is the name of the function as configured/deployed on the FaaS
@@ -417,7 +448,7 @@ const (
// The unique ID of the single function that this runtime instance executes.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:lambda:us-west-2:123456789012:function:my-function'
// Note: On some cloud providers, it may not be possible to determine the full ID
@@ -449,7 +480,7 @@ const (
// The immutable version of the function being executed.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '26', 'pinkfroid-00002'
// Note: Depending on the cloud provider and platform, use:
@@ -471,7 +502,7 @@ const (
// other invocations to the same function/function version.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de'
// Note: * **AWS Lambda:** Use the (full) log stream name.
@@ -479,7 +510,7 @@ const (
// The amount of memory available to the serverless function in MiB.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 128
// Note: It's recommended to set this attribute since e.g. too little memory can
@@ -492,46 +523,47 @@ const (
// A host is defined as a general computing instance.
const (
// Unique host ID. For Cloud, this must be the instance_id assigned by the cloud
- // provider.
+ // provider. For non-containerized Linux systems, the `machine-id` located in
+ // `/etc/machine-id` or `/var/lib/dbus/machine-id` may be used.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
- // Examples: 'opentelemetry-test'
+ // Examples: 'fdbf79e8af94cb7f9e8df36789187052'
HostIDKey = attribute.Key("host.id")
// Name of the host. On Unix systems, it may contain what the hostname command
// returns, or the fully qualified hostname, or another name specified by the
// user.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry-test'
HostNameKey = attribute.Key("host.name")
// Type of host. For Cloud, this must be the machine type.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'n1-standard-1'
HostTypeKey = attribute.Key("host.type")
// The CPU architecture the host system is running on.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
HostArchKey = attribute.Key("host.arch")
// Name of the VM image or OS install the host was instantiated from.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905'
HostImageNameKey = attribute.Key("host.image.name")
// VM image ID. For Cloud, this value is from the provider.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'ami-07b06b442921831e5'
HostImageIDKey = attribute.Key("host.image.id")
@@ -539,7 +571,7 @@ const (
// Attributes](README.md#version-attributes).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '0.1'
HostImageVersionKey = attribute.Key("host.image.version")
@@ -569,7 +601,7 @@ const (
// The name of the cluster.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry-cluster'
K8SClusterNameKey = attribute.Key("k8s.cluster.name")
@@ -580,14 +612,14 @@ const (
// The name of the Node.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'node-1'
K8SNodeNameKey = attribute.Key("k8s.node.name")
// The UID of the Node.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2'
K8SNodeUIDKey = attribute.Key("k8s.node.uid")
@@ -598,7 +630,7 @@ const (
// The name of the namespace that the pod is running in.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'default'
K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
@@ -609,14 +641,14 @@ const (
// The UID of the Pod.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
K8SPodUIDKey = attribute.Key("k8s.pod.uid")
// The name of the Pod.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry-pod-autoconf'
K8SPodNameKey = attribute.Key("k8s.pod.name")
@@ -629,7 +661,7 @@ const (
// (`container.name`).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'redis'
K8SContainerNameKey = attribute.Key("k8s.container.name")
@@ -637,7 +669,7 @@ const (
// identify a particular container (running or stopped) within a container spec.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 0, 2
K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count")
@@ -648,14 +680,14 @@ const (
// The UID of the ReplicaSet.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
// The name of the ReplicaSet.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry'
K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
@@ -666,14 +698,14 @@ const (
// The UID of the Deployment.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
// The name of the Deployment.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry'
K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
@@ -684,14 +716,14 @@ const (
// The UID of the StatefulSet.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
// The name of the StatefulSet.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry'
K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
@@ -702,14 +734,14 @@ const (
// The UID of the DaemonSet.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
// The name of the DaemonSet.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry'
K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
@@ -720,14 +752,14 @@ const (
// The UID of the Job.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
K8SJobUIDKey = attribute.Key("k8s.job.uid")
// The name of the Job.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry'
K8SJobNameKey = attribute.Key("k8s.job.name")
@@ -738,14 +770,14 @@ const (
// The UID of the CronJob.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
// The name of the CronJob.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry'
K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
@@ -756,21 +788,21 @@ const (
// The operating system type.
//
// Type: Enum
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
OSTypeKey = attribute.Key("os.type")
// Human readable (not intended to be parsed) OS version information, like e.g.
// reported by `ver` or `lsb_release -a` commands.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 LTS'
OSDescriptionKey = attribute.Key("os.description")
// Human readable operating system name.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'iOS', 'Android', 'Ubuntu'
OSNameKey = attribute.Key("os.name")
@@ -778,7 +810,7 @@ const (
// Attributes](../../resource/semantic_conventions/README.md#version-attributes).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '14.2.1', '18.04.1'
OSVersionKey = attribute.Key("os.version")
@@ -814,16 +846,23 @@ const (
// Process identifier (PID).
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 1234
ProcessPIDKey = attribute.Key("process.pid")
+ // Parent Process identifier (PID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 111
+ ProcessParentPIDKey = attribute.Key("process.parent_pid")
// The name of the process executable. On Linux based systems, can be set to the
// `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of
// `GetProcessImageFileNameW`.
//
// Type: string
- // Required: See below
+ // RequirementLevel: ConditionallyRequired (See alternative attributes below.)
// Stability: stable
// Examples: 'otelcol'
ProcessExecutableNameKey = attribute.Key("process.executable.name")
@@ -832,7 +871,7 @@ const (
// `GetProcessImageFileNameW`.
//
// Type: string
- // Required: See below
+ // RequirementLevel: ConditionallyRequired (See alternative attributes below.)
// Stability: stable
// Examples: '/usr/bin/cmd/otelcol'
ProcessExecutablePathKey = attribute.Key("process.executable.path")
@@ -841,7 +880,7 @@ const (
// can be set to the first parameter extracted from `GetCommandLineW`.
//
// Type: string
- // Required: See below
+ // RequirementLevel: ConditionallyRequired (See alternative attributes below.)
// Stability: stable
// Examples: 'cmd/otelcol'
ProcessCommandKey = attribute.Key("process.command")
@@ -851,7 +890,7 @@ const (
// `process.command_args` instead.
//
// Type: string
- // Required: See below
+ // RequirementLevel: ConditionallyRequired (See alternative attributes below.)
// Stability: stable
// Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"'
ProcessCommandLineKey = attribute.Key("process.command_line")
@@ -862,14 +901,14 @@ const (
// the full argv vector passed to `main`.
//
// Type: string[]
- // Required: See below
+ // RequirementLevel: ConditionallyRequired (See alternative attributes below.)
// Stability: stable
// Examples: 'cmd/otecol', '--config=config.yaml'
ProcessCommandArgsKey = attribute.Key("process.command_args")
// The username of the user that owns the process.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'root'
ProcessOwnerKey = attribute.Key("process.owner")
@@ -881,7 +920,7 @@ const (
// SHOULD be the name of the compiler.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'OpenJDK Runtime Environment'
ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
@@ -889,7 +928,7 @@ const (
// modification.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '14.0.2'
ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
@@ -897,7 +936,7 @@ const (
// specific vendor customization of the runtime environment.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0'
ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
@@ -908,7 +947,7 @@ const (
// Logical name of the service.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'shoppingcart'
// Note: MUST be the same for all instances of horizontally scaled services. If
@@ -920,7 +959,7 @@ const (
// A namespace for `service.name`.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Shop'
// Note: A string value having a meaning that helps to distinguish a group of
@@ -934,7 +973,7 @@ const (
// The string ID of the service instance.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '627cc493-f310-47de-96bd-71410b7dec09'
// Note: MUST be unique for each instance of the same
@@ -953,7 +992,7 @@ const (
// The version string of the service API or implementation.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '2.0.0'
ServiceVersionKey = attribute.Key("service.version")
@@ -964,27 +1003,27 @@ const (
// The name of the telemetry SDK as defined above.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'opentelemetry'
TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
// The language of the telemetry SDK.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
// The version string of the telemetry SDK.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '1.2.3'
TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
// The version string of the auto instrumentation agent, if used.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '1.2.3'
TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version")
@@ -1020,14 +1059,14 @@ const (
// The name of the web engine.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'WildFly'
WebEngineNameKey = attribute.Key("webengine.name")
// The version of the web engine.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '21.0.0'
WebEngineVersionKey = attribute.Key("webengine.version")
@@ -1035,8 +1074,45 @@ const (
// information).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final'
WebEngineDescriptionKey = attribute.Key("webengine.description")
)
+
+// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts.
+const (
+ // The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ OtelScopeNameKey = attribute.Key("otel.scope.name")
+ // The version of the instrumentation scope - (`InstrumentationScope.Version` in
+ // OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.0.0'
+ OtelScopeVersionKey = attribute.Key("otel.scope.version")
+)
+
+// Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts.
+const (
+ // Deprecated, use the `otel.scope.name` attribute.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ OtelLibraryNameKey = attribute.Key("otel.library.name")
+ // Deprecated, use the `otel.scope.version` attribute.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '1.0.0'
+ OtelLibraryVersionKey = attribute.Key("otel.library.version")
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
similarity index 93%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
index 2f2a019e4..42fc525d1 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
// SchemaURL is the schema URL that matches the version of the semantic conventions
// that this package defines. Semconv packages starting from v1.4.0 must declare
// non-empty schema URL in the form https://opentelemetry.io/schemas/
-const SchemaURL = "https://opentelemetry.io/schemas/1.12.0"
+const SchemaURL = "https://opentelemetry.io/schemas/1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
similarity index 71%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
index 047d8e95c..01e5f072a 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
@@ -14,10 +14,71 @@
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
import "go.opentelemetry.io/otel/attribute"
+// This document defines the shared attributes used to report a single exception associated with a span or log.
+const (
+ // The type of the exception (its fully-qualified class name, if applicable). The
+ // dynamic type of the exception should be preferred over the static type in
+ // languages that support it.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'java.net.ConnectException', 'OSError'
+ ExceptionTypeKey = attribute.Key("exception.type")
+ // The exception message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Division by zero', "Can't convert 'int' object to str implicitly"
+ ExceptionMessageKey = attribute.Key("exception.message")
+ // A stacktrace as a string in the natural representation for the language
+ // runtime. The representation is to be determined and documented by each language
+ // SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
+ // exception\\n at '
+ // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
+)
+
+// This document defines attributes for Events represented using Log Records.
+const (
+ // The name identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'click', 'exception'
+ EventNameKey = attribute.Key("event.name")
+ // The domain identifies the business context for the events.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Note: Events across different domains may have same `event.name`, yet be
+ // unrelated events.
+ EventDomainKey = attribute.Key("event.domain")
+)
+
+var (
+ // Events from browser apps
+ EventDomainBrowser = EventDomainKey.String("browser")
+ // Events from mobile apps
+ EventDomainDevice = EventDomainKey.String("device")
+ // Events from Kubernetes
+ EventDomainK8S = EventDomainKey.String("k8s")
+)
+
// Span attributes used by AWS Lambda (in addition to general `faas` attributes).
const (
// The full invoked ARN as provided on the `Context` passed to the function
@@ -25,7 +86,7 @@ const (
// applicable).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
// Note: This may be different from `faas.id` if an alias is involved.
@@ -38,7 +99,7 @@ const (
// .md#id) uniquely identifies the event.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
@@ -46,7 +107,7 @@ const (
// d#source-1) identifies the context in which an event happened.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'https://github.com/cloudevents', '/cloudevents/spec/pull/123', 'my-
// service'
@@ -55,7 +116,7 @@ const (
// pec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '1.0'
CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
@@ -64,7 +125,7 @@ const (
// originating occurrence.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'com.github.pull_request.opened', 'com.example.object.deleted.v2'
CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
@@ -73,7 +134,7 @@ const (
// source).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'mynewfile.jpg'
CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
@@ -84,7 +145,7 @@ const (
// Parent-child Reference type
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Note: The causal relationship between a child Span and a parent Span.
OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
@@ -103,21 +164,21 @@ const (
// below for a list of well-known identifiers.
//
// Type: Enum
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
DBSystemKey = attribute.Key("db.system")
// The connection string used to connect to the database. It is recommended to
// remove embedded credentials.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;'
DBConnectionStringKey = attribute.Key("db.connection_string")
// Username for accessing the database.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'readonly_user', 'reporting_user'
DBUserKey = attribute.Key("db.user")
@@ -126,7 +187,7 @@ const (
// used to connect.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'org.postgresql.Driver',
// 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
@@ -136,7 +197,7 @@ const (
// (even if the command fails).
//
// Type: string
- // Required: Required, if applicable.
+ // RequirementLevel: ConditionallyRequired (If applicable.)
// Stability: stable
// Examples: 'customers', 'main'
// Note: In some SQL databases, the database name to be used is called "schema
@@ -147,8 +208,8 @@ const (
// The database statement being executed.
//
// Type: string
- // Required: Required if applicable and not explicitly disabled via
- // instrumentation configuration.
+ // RequirementLevel: ConditionallyRequired (If applicable and not explicitly
+ // disabled via instrumentation configuration.)
// Stability: stable
// Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
// Note: The value may be sanitized to exclude sensitive information.
@@ -158,7 +219,7 @@ const (
// such as `findAndModify`, or the SQL keyword.
//
// Type: string
- // Required: Required, if `db.statement` is not applicable.
+ // RequirementLevel: ConditionallyRequired (If `db.statement` is not applicable.)
// Stability: stable
// Examples: 'findAndModify', 'HMSET', 'SELECT'
// Note: When setting this to an SQL keyword, it is not recommended to attempt any
@@ -264,6 +325,10 @@ var (
DBSystemMemcached = DBSystemKey.String("memcached")
// CockroachDB
DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
+ // OpenSearch
+ DBSystemOpensearch = DBSystemKey.String("opensearch")
+ // ClickHouse
+ DBSystemClickhouse = DBSystemKey.String("clickhouse")
)
// Connection-level attributes for Microsoft SQL Server
@@ -273,7 +338,7 @@ const (
// connecting to. This name is used to determine the port of a named instance.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'MSSQLSERVER'
// Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer
@@ -286,7 +351,7 @@ const (
// The fetch size used for paging, i.e. how many rows will be returned at once.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 5000
DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
@@ -295,14 +360,14 @@ const (
// oss/3.0/cassandra/dml/dmlConfigConsistency.html).
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
// The name of the primary table that the operation is acting upon, including the
// keyspace name (if applicable).
//
// Type: string
- // Required: Recommended if available.
+ // RequirementLevel: Recommended
// Stability: stable
// Examples: 'mytable'
// Note: This mirrors the db.sql.table attribute but references cassandra rather
@@ -314,28 +379,28 @@ const (
// Whether or not the query is idempotent.
//
// Type: boolean
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
// The number of times a query was speculatively executed. Not set or `0` if the
// query was not executed speculatively.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 0, 2
DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
// The ID of the coordinating node for a query.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
// The data center of the coordinating node for a query.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'us-west-2'
DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
@@ -373,7 +438,8 @@ const (
// instead of the generic `db.name` attribute.
//
// Type: int
- // Required: Required, if other than the default database (`0`).
+ // RequirementLevel: ConditionallyRequired (If other than the default database
+ // (`0`).)
// Stability: stable
// Examples: 0, 1, 15
DBRedisDBIndexKey = attribute.Key("db.redis.database_index")
@@ -384,7 +450,7 @@ const (
// The collection being accessed within the database stated in `db.name`.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'customers', 'products'
DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection")
@@ -396,7 +462,7 @@ const (
// database name (if applicable).
//
// Type: string
- // Required: Recommended if available.
+ // RequirementLevel: Recommended
// Stability: stable
// Examples: 'public.users', 'customers'
// Note: It is not recommended to attempt any client-side parsing of
@@ -406,61 +472,29 @@ const (
DBSQLTableKey = attribute.Key("db.sql.table")
)
-// This document defines the attributes used to report a single exception associated with a span.
+// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's concepts.
const (
- // The type of the exception (its fully-qualified class name, if applicable). The
- // dynamic type of the exception should be preferred over the static type in
- // languages that support it.
+ // Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is
+ // UNSET.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ OtelStatusCodeKey = attribute.Key("otel.status_code")
+ // Description of the Status if it has a value, otherwise not set.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
- // Examples: 'java.net.ConnectException', 'OSError'
- ExceptionTypeKey = attribute.Key("exception.type")
- // The exception message.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: 'Division by zero', "Can't convert 'int' object to str implicitly"
- ExceptionMessageKey = attribute.Key("exception.message")
- // A stacktrace as a string in the natural representation for the language
- // runtime. The representation is to be determined and documented by each language
- // SIG.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
- // exception\\n at '
- // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
- // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
- // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
- ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
- // SHOULD be set to true if the exception event is recorded at a point where it is
- // known that the exception is escaping the scope of the span.
- //
- // Type: boolean
- // Required: No
- // Stability: stable
- // Note: An exception is considered to have escaped (or left) the scope of a span,
- // if that span is ended while the exception is still logically "in flight".
- // This may be actually "in flight" in some languages (e.g. if the exception
- // is passed to a Context manager's `__exit__` method in Python) but will
- // usually be caught at the point of recording the exception in most languages.
+ // Examples: 'resource not found'
+ OtelStatusDescriptionKey = attribute.Key("otel.status_description")
+)
- // It is usually not possible to determine at the point where an exception is
- // thrown
- // whether it will escape the scope of a span.
- // However, it is trivial to know that an exception
- // will escape, if one checks for an active exception just before ending the span,
- // as done in the [example above](#recording-an-exception).
-
- // It follows that an exception may still escape the scope of the span
- // even if the `exception.escaped` attribute was not set or set to false,
- // since the event might have been recorded at a time where it was not
- // clear whether the exception will escape.
- ExceptionEscapedKey = attribute.Key("exception.escaped")
+var (
+ // The operation has been validated by an Application developer or Operator to have completed successfully
+ OtelStatusCodeOk = OtelStatusCodeKey.String("OK")
+ // The operation contains an error
+ OtelStatusCodeError = OtelStatusCodeKey.String("ERROR")
)
// This semantic convention describes an instance of a function that runs without provisioning or managing of servers (also known as serverless functions or Function as a Service (FaaS)) with spans.
@@ -468,7 +502,7 @@ const (
// Type of the trigger which caused this function execution.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Note: For the server/consumer span on the incoming side,
// `faas.trigger` MUST be set.
@@ -483,7 +517,7 @@ const (
// The execution ID of the current function execution.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
FaaSExecutionKey = attribute.Key("faas.execution")
@@ -509,14 +543,14 @@ const (
// DB to the database name.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'myBucketName', 'myDBName'
FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
// Describes the type of the operation that was performed on the data.
//
// Type: Enum
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
// A string containing the time when the data was accessed in the [ISO
@@ -524,7 +558,7 @@ const (
// in [UTC](https://www.w3.org/TR/NOTE-datetime).
//
// Type: string
- // Required: Always
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '2020-01-23T13:47:06Z'
FaaSDocumentTimeKey = attribute.Key("faas.document.time")
@@ -532,7 +566,7 @@ const (
// Storage or S3 is the name of the file, and in Cosmos DB the table name.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'myFile.txt', 'myTableName'
FaaSDocumentNameKey = attribute.Key("faas.document.name")
@@ -554,7 +588,7 @@ const (
// in [UTC](https://www.w3.org/TR/NOTE-datetime).
//
// Type: string
- // Required: Always
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '2020-01-23T13:47:06Z'
FaaSTimeKey = attribute.Key("faas.time")
@@ -562,7 +596,7 @@ const (
// e.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '0/5 * * * ? *'
FaaSCronKey = attribute.Key("faas.cron")
@@ -574,7 +608,7 @@ const (
// time (aka cold-start).
//
// Type: boolean
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
FaaSColdstartKey = attribute.Key("faas.coldstart")
)
@@ -584,7 +618,7 @@ const (
// The name of the invoked function.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'my-function'
// Note: SHOULD be equal to the `faas.name` resource attribute of the invoked
@@ -593,7 +627,7 @@ const (
// The cloud provider of the invoked function.
//
// Type: Enum
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked
// function.
@@ -601,12 +635,13 @@ const (
// The cloud region of the invoked function.
//
// Type: string
- // Required: For some cloud providers, like AWS or GCP, the region in which a
- // function is hosted is essential to uniquely identify the function and also part
- // of its endpoint. Since it's part of the endpoint being called, the region is
- // always known to clients. In these cases, `faas.invoked_region` MUST be set
- // accordingly. If the region is unknown to the client or not required for
- // identifying the invoked function, setting `faas.invoked_region` is optional.
+ // RequirementLevel: ConditionallyRequired (For some cloud providers, like AWS or
+ // GCP, the region in which a function is hosted is essential to uniquely identify
+ // the function and also part of its endpoint. Since it's part of the endpoint
+ // being called, the region is always known to clients. In these cases,
+ // `faas.invoked_region` MUST be set accordingly. If the region is unknown to the
+ // client or not required for identifying the invoked function, setting
+ // `faas.invoked_region` is optional.)
// Stability: stable
// Examples: 'eu-central-1'
// Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked
@@ -632,58 +667,113 @@ const (
// Transport protocol used. See note below.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
NetTransportKey = attribute.Key("net.transport")
- // Remote address of the peer (dotted decimal for IPv4 or
- // [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6)
+ // Application layer protocol used. The value SHOULD be normalized to lowercase.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
- // Examples: '127.0.0.1'
- NetPeerIPKey = attribute.Key("net.peer.ip")
- // Remote port number.
+ // Examples: 'amqp', 'http', 'mqtt'
+ NetAppProtocolNameKey = attribute.Key("net.app.protocol.name")
+ // Version of the application layer protocol used. See note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '3.1.1'
+ // Note: `net.app.protocol.version` refers to the version of the protocol used and
+ // might be different from the protocol client's version. If the HTTP client used
+ // has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should
+ // be set to `1.1`.
+ NetAppProtocolVersionKey = attribute.Key("net.app.protocol.version")
+ // Remote socket peer name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended (If available and different from `net.peer.name`
+ // and if `net.sock.peer.addr` is set.)
+ // Stability: stable
+ // Examples: 'proxy.example.com'
+ NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
+ // Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local
+ // communication, [etc](https://man7.org/linux/man-
+ // pages/man7/address_families.7.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '127.0.0.1', '/tmp/mysql.sock'
+ NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
+ // Remote socket peer port.
//
// Type: int
- // Required: No
+ // RequirementLevel: Recommended (If defined for the address family and if
+ // different than `net.peer.port` and if `net.sock.peer.addr` is set.)
// Stability: stable
- // Examples: 80, 8080, 443
- NetPeerPortKey = attribute.Key("net.peer.port")
- // Remote hostname or similar, see note below.
+ // Examples: 16456
+ NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
+ // Protocol [address family](https://man7.org/linux/man-
+ // pages/man7/address_families.7.html) which is used for communication.
+ //
+ // Type: Enum
+ // RequirementLevel: ConditionallyRequired (If different than `inet` and if any of
+ // `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers of telemetry
+ // SHOULD accept both IPv4 and IPv6 formats for the address in
+ // `net.sock.peer.addr` if `net.sock.family` is not set. This is to support
+ // instrumentations that follow previous versions of this document.)
+ // Stability: stable
+ // Examples: 'inet6', 'bluetooth'
+ NetSockFamilyKey = attribute.Key("net.sock.family")
+ // Logical remote hostname, see note below.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'example.com'
// Note: `net.peer.name` SHOULD NOT be set if capturing it would require an extra
// DNS lookup.
NetPeerNameKey = attribute.Key("net.peer.name")
- // Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: '192.168.0.1'
- NetHostIPKey = attribute.Key("net.host.ip")
- // Like `net.peer.port` but for the host port.
+ // Logical remote port number
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
- // Examples: 35555
- NetHostPortKey = attribute.Key("net.host.port")
- // Local hostname or similar, see note below.
+ // Examples: 80, 8080, 443
+ NetPeerPortKey = attribute.Key("net.peer.port")
+ // Logical local hostname or similar, see note below.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'localhost'
NetHostNameKey = attribute.Key("net.host.name")
+ // Logical local port number, preferably the one that the peer used to connect
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 8080
+ NetHostPortKey = attribute.Key("net.host.port")
+ // Local socket address. Useful in case of a multi-IP host.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '192.168.0.1'
+ NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
+ // Local socket port number.
+ //
+ // Type: int
+ // RequirementLevel: Recommended (If defined for the address family and if
+ // different than `net.host.port` and if `net.sock.host.addr` is set.)
+ // Stability: stable
+ // Examples: 35555
+ NetSockHostPortKey = attribute.Key("net.sock.host.port")
// The internet connection type currently being used by the host.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'wifi'
NetHostConnectionTypeKey = attribute.Key("net.host.connection.type")
@@ -692,28 +782,28 @@ const (
// about a wifi connection.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'LTE'
NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype")
// The name of the mobile carrier.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'sprint'
NetHostCarrierNameKey = attribute.Key("net.host.carrier.name")
// The mobile carrier country code.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '310'
NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc")
// The mobile carrier network code.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '001'
NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc")
@@ -721,7 +811,7 @@ const (
// carrier network.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'DE'
NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc")
@@ -732,10 +822,6 @@ var (
NetTransportTCP = NetTransportKey.String("ip_tcp")
// ip_udp
NetTransportUDP = NetTransportKey.String("ip_udp")
- // Another IP-based protocol
- NetTransportIP = NetTransportKey.String("ip")
- // Unix Domain socket. See below
- NetTransportUnix = NetTransportKey.String("unix")
// Named or anonymous pipe. See note below
NetTransportPipe = NetTransportKey.String("pipe")
// In-process communication
@@ -744,6 +830,15 @@ var (
NetTransportOther = NetTransportKey.String("other")
)
+var (
+ // IPv4 address
+ NetSockFamilyInet = NetSockFamilyKey.String("inet")
+ // IPv6 address
+ NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
+ // Unix domain socket path
+ NetSockFamilyUnix = NetSockFamilyKey.String("unix")
+)
+
var (
// wifi
NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi")
@@ -809,7 +904,7 @@ const (
// attribute of the remote service if any.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'AuthTokenCache'
PeerServiceKey = attribute.Key("peer.service")
@@ -822,7 +917,7 @@ const (
// inbound request from outside the system.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'username'
EnduserIDKey = attribute.Key("enduser.id")
@@ -830,7 +925,7 @@ const (
// or application security context.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'admin'
EnduserRoleKey = attribute.Key("enduser.role")
@@ -842,7 +937,7 @@ const (
// open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'read:message, write:files'
EnduserScopeKey = attribute.Key("enduser.scope")
@@ -853,14 +948,14 @@ const (
// Current "managed" thread ID (as opposed to OS thread ID).
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 42
ThreadIDKey = attribute.Key("thread.id")
// Current thread name.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'main'
ThreadNameKey = attribute.Key("thread.name")
@@ -872,7 +967,7 @@ const (
// unit's name).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'serveRequest'
CodeFunctionKey = attribute.Key("code.function")
@@ -881,7 +976,7 @@ const (
// `code.function` form a unique identifier for the code unit.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'com.example.MyHTTPService'
CodeNamespaceKey = attribute.Key("code.namespace")
@@ -889,7 +984,7 @@ const (
// (preferably an absolute file path).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '/usr/local/MyApplication/content_root/app/index.php'
CodeFilepathKey = attribute.Key("code.filepath")
@@ -897,10 +992,18 @@ const (
// point within the code unit named in `code.function`.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 42
CodeLineNumberKey = attribute.Key("code.lineno")
+ // The column number in `code.filepath` best representing the operation. It SHOULD
+ // point within the code unit named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 16
+ CodeColumnKey = attribute.Key("code.column")
)
// This document defines semantic conventions for HTTP client and server Spans.
@@ -908,117 +1011,55 @@ const (
// HTTP request method.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'GET', 'POST', 'HEAD'
HTTPMethodKey = attribute.Key("http.method")
- // Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`.
- // Usually the fragment is not transmitted over HTTP, but if it is known, it
- // should be included nevertheless.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
- // Note: `http.url` MUST NOT contain credentials passed via URL in form of
- // `https://username:password@www.example.com/`. In such case the attribute's
- // value should be `https://www.example.com/`.
- HTTPURLKey = attribute.Key("http.url")
- // The full request target as passed in a HTTP request line or equivalent.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: '/path/12314/?q=ddds#123'
- HTTPTargetKey = attribute.Key("http.target")
- // The value of the [HTTP host
- // header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header
- // should also be reported, see note.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: 'www.example.org'
- // Note: When the header is present but empty the attribute SHOULD be set to the
- // empty string. Note that this is a valid situation that is expected in certain
- // cases, according the aforementioned [section of RFC
- // 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not
- // set the attribute MUST NOT be set.
- HTTPHostKey = attribute.Key("http.host")
- // The URI scheme identifying the used protocol.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: 'http', 'https'
- HTTPSchemeKey = attribute.Key("http.scheme")
// [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
//
// Type: int
- // Required: If and only if one was received/sent.
+ // RequirementLevel: ConditionallyRequired (If and only if one was received/sent.)
// Stability: stable
// Examples: 200
HTTPStatusCodeKey = attribute.Key("http.status_code")
// Kind of HTTP protocol used.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP`
// except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.
HTTPFlavorKey = attribute.Key("http.flavor")
- // Value of the [HTTP User-
- // Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the
- // client.
+ // Value of the [HTTP User-Agent](https://www.rfc-
+ // editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
HTTPUserAgentKey = attribute.Key("http.user_agent")
// The size of the request payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the
- // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For
- // requests using transport encoding, this should be the compressed size.
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-
+ // length) header. For requests using transport encoding, this should be the
+ // compressed size.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 3495
HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
- // The size of the uncompressed request payload body after transport decoding. Not
- // set if transport encoding not used.
- //
- // Type: int
- // Required: No
- // Stability: stable
- // Examples: 5493
- HTTPRequestContentLengthUncompressedKey = attribute.Key("http.request_content_length_uncompressed")
// The size of the response payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the
- // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For
- // requests using transport encoding, this should be the compressed size.
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-
+ // length) header. For requests using transport encoding, this should be the
+ // compressed size.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 3495
HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
- // The size of the uncompressed response payload body after transport decoding.
- // Not set if transport encoding not used.
- //
- // Type: int
- // Required: No
- // Stability: stable
- // Examples: 5493
- HTTPResponseContentLengthUncompressedKey = attribute.Key("http.response_content_length_uncompressed")
- // The ordinal number of request re-sending attempt.
- //
- // Type: int
- // Required: If and only if a request was retried.
- // Stability: stable
- // Examples: 3
- HTTPRetryCountKey = attribute.Key("http.retry_count")
)
var (
@@ -1036,45 +1077,78 @@ var (
HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC")
)
+// Semantic Convention for HTTP Client
+const (
+ // Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`.
+ // Usually the fragment is not transmitted over HTTP, but if it is known, it
+ // should be included nevertheless.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
+ // Note: `http.url` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case the attribute's
+ // value should be `https://www.example.com/`.
+ HTTPURLKey = attribute.Key("http.url")
+ // The ordinal number of request resending attempt (for any reason, including
+ // redirects).
+ //
+ // Type: int
+ // RequirementLevel: Recommended (if and only if request was retried.)
+ // Stability: stable
+ // Examples: 3
+ // Note: The resend count SHOULD be updated each time an HTTP request gets resent
+ // by the client, regardless of what was the cause of the resending (e.g.
+ // redirection, authorization failure, 503 Server Unavailable, network issues, or
+ // any other).
+ HTTPResendCountKey = attribute.Key("http.resend_count")
+)
+
// Semantic Convention for HTTP Server
const (
- // The primary server name of the matched virtual host. This should be obtained
- // via configuration. If no such configuration can be obtained, this attribute
- // MUST NOT be set ( `net.host.name` should be used instead).
+ // The URI scheme identifying the used protocol.
//
// Type: string
- // Required: No
+ // RequirementLevel: Required
// Stability: stable
- // Examples: 'example.com'
- // Note: `http.url` is usually not readily available on the server side but would
- // have to be assembled in a cumbersome and sometimes lossy process from other
- // information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus
- // preferred to supply the raw data that is available.
- HTTPServerNameKey = attribute.Key("http.server_name")
- // The matched route (path template).
+ // Examples: 'http', 'https'
+ HTTPSchemeKey = attribute.Key("http.scheme")
+ // The full request target as passed in a HTTP request line or equivalent.
//
// Type: string
- // Required: No
+ // RequirementLevel: Required
// Stability: stable
- // Examples: '/users/:userID?'
+ // Examples: '/path/12314/?q=ddds'
+ HTTPTargetKey = attribute.Key("http.target")
+ // The matched route (path template in the format used by the respective server
+ // framework). See note below
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If and only if it's available)
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: 'http.route' MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and the URI
+ // path can NOT substitute it.
HTTPRouteKey = attribute.Key("http.route")
// The IP address of the original client behind all proxies, if known (e.g. from
// [X-Forwarded-For](https://developer.mozilla.org/en-
// US/docs/Web/HTTP/Headers/X-Forwarded-For)).
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '83.164.160.102'
- // Note: This is not necessarily the same as `net.peer.ip`, which would
+ // Note: This is not necessarily the same as `net.sock.peer.addr`, which would
// identify the network-level peer, which may be a proxy.
// This attribute should be set when a source of information different
- // from the one used for `net.peer.ip`, is available even if that other
- // source just confirms the same value as `net.peer.ip`.
- // Rationale: For `net.peer.ip`, one typically does not know if it
+ // from the one used for `net.sock.peer.addr`, is available even if that other
+ // source just confirms the same value as `net.sock.peer.addr`.
+ // Rationale: For `net.sock.peer.addr`, one typically does not know if it
// comes from a proxy, reverse proxy, or the actual client. Setting
- // `http.client_ip` when it's the same as `net.peer.ip` means that
+ // `http.client_ip` when it's the same as `net.sock.peer.addr` means that
// one is at least somewhat confident that the address is not that of
// the closest proxy.
HTTPClientIPKey = attribute.Key("http.client_ip")
@@ -1085,7 +1159,7 @@ const (
// The keys in the `RequestItems` object field.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Users', 'Cats'
AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
@@ -1093,7 +1167,7 @@ const (
// field.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : {
// "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits":
@@ -1106,7 +1180,7 @@ const (
// The JSON-serialized value of the `ItemCollectionMetrics` response field.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob,
// "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" :
@@ -1116,27 +1190,27 @@ const (
// The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.
//
// Type: double
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 1.0, 2.0
AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
// The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.
//
// Type: double
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 1.0, 2.0
AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
// The value of the `ConsistentRead` request parameter.
//
// Type: boolean
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
// The value of the `ProjectionExpression` request parameter.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Title', 'Title, Price, Color', 'Title, Description, RelatedItems,
// ProductReviews'
@@ -1144,28 +1218,28 @@ const (
// The value of the `Limit` request parameter.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 10
AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
// The value of the `AttributesToGet` request parameter.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'lives', 'id'
AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
// The value of the `IndexName` request parameter.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'name_to_group'
AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
// The value of the `Select` request parameter.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'ALL_ATTRIBUTES', 'COUNT'
AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
@@ -1177,7 +1251,7 @@ const (
// field
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string",
// "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ],
@@ -1188,7 +1262,7 @@ const (
// field.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '{ "IndexARN": "string", "IndexName": "string", "IndexSizeBytes":
// number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string",
@@ -1202,14 +1276,14 @@ const (
// The value of the `ExclusiveStartTableName` request parameter.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Users', 'CatsTable'
AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
// The the number of items in the `TableNames` response parameter.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 20
AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
@@ -1220,7 +1294,7 @@ const (
// The value of the `ScanIndexForward` request parameter.
//
// Type: boolean
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
)
@@ -1230,28 +1304,28 @@ const (
// The value of the `Segment` request parameter.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 10
AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
// The value of the `TotalSegments` request parameter.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 100
AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
// The value of the `Count` response parameter.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 10
AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
// The value of the `ScannedCount` response parameter.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 50
AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
@@ -1263,7 +1337,7 @@ const (
// field.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
@@ -1271,7 +1345,7 @@ const (
// request field.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
// "AttributeName": "string", "KeyType": "string" } ], "Projection": {
@@ -1281,90 +1355,121 @@ const (
AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
)
-// This document defines the attributes used in messaging systems.
+// This document defines semantic conventions to apply when instrumenting the GraphQL implementation. They map GraphQL operations to attributes on a Span.
const (
- // A string identifying the messaging system.
+ // The name of the operation being executed.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Optional
// Stability: stable
- // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS'
- MessagingSystemKey = attribute.Key("messaging.system")
- // The message destination name. This might be equal to the span name but is
- // required nevertheless.
- //
- // Type: string
- // Required: Always
- // Stability: stable
- // Examples: 'MyQueue', 'MyTopic'
- MessagingDestinationKey = attribute.Key("messaging.destination")
- // The kind of message destination
+ // Examples: 'findBookByID'
+ GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
+ // The type of the operation being executed.
//
// Type: Enum
- // Required: Required only if the message destination is either a `queue` or
- // `topic`.
+ // RequirementLevel: Optional
// Stability: stable
- MessagingDestinationKindKey = attribute.Key("messaging.destination_kind")
- // A boolean that is true if the message destination is temporary.
- //
- // Type: boolean
- // Required: If missing, it is assumed to be false.
- // Stability: stable
- MessagingTempDestinationKey = attribute.Key("messaging.temp_destination")
- // The name of the transport protocol.
+ // Examples: 'query', 'mutation', 'subscription'
+ GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
+ // The GraphQL document being executed.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
- // Examples: 'AMQP', 'MQTT'
- MessagingProtocolKey = attribute.Key("messaging.protocol")
- // The version of the transport protocol.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: '0.9.1'
- MessagingProtocolVersionKey = attribute.Key("messaging.protocol_version")
- // Connection string.
- //
- // Type: string
- // Required: No
- // Stability: stable
- // Examples: 'tibjmsnaming://localhost:7222',
- // 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue'
- MessagingURLKey = attribute.Key("messaging.url")
+ // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
+ // Note: The value may be sanitized to exclude sensitive information.
+ GraphqlDocumentKey = attribute.Key("graphql.document")
+)
+
+var (
+ // GraphQL query
+ GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
+ // GraphQL mutation
+ GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
+ // GraphQL subscription
+ GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
+)
+
+// Semantic convention describing per-message attributes populated on messaging spans or links.
+const (
// A value used by the messaging system as an identifier for the message,
// represented as a string.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '452a7c7c7c7048c2f887f61572b18fc2'
- MessagingMessageIDKey = attribute.Key("messaging.message_id")
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
// The [conversation ID](#conversations) identifying the conversation to which the
// message belongs, represented as a string. Sometimes called "Correlation ID".
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'MyConversationID'
- MessagingConversationIDKey = attribute.Key("messaging.conversation_id")
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
// The (uncompressed) size of the message payload in bytes. Also use this
// attribute if it is unknown whether the compressed or uncompressed payload size
// is reported.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 2738
- MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message_payload_size_bytes")
+ MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
// The compressed size of the message payload in bytes.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 2048
- MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message_payload_compressed_size_bytes")
+ MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
+)
+
+// Semantic convention for attributes that describe messaging destination on broker
+const (
+ // The message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic or
+ // other entity within the broker. If
+ // the broker does not have such notion, the destination name SHOULD uniquely
+ // identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+ // The kind of message destination
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationKindKey = attribute.Key("messaging.destination.kind")
+ // Low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example would
+ // be a destination name involving a user name or product id. Although the
+ // destination name in this case is of high cardinality, the underlying template
+ // is of low cardinality and can be effectively used for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+ // A boolean that is true if the message destination is temporary and might not
+ // exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+ // A boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
)
var (
@@ -1374,90 +1479,184 @@ var (
MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic")
)
-// Semantic convention for a consumer of messages received from a messaging system
+// Semantic convention for attributes that describe messaging source on broker
const (
- // A string identifying the kind of message consumption as defined in the
- // [Operation names](#operation-names) section above. If the operation is "send",
- // this attribute MUST NOT be set, since the operation can be inferred from the
- // span kind in that case.
- //
- // Type: Enum
- // Required: No
- // Stability: stable
- MessagingOperationKey = attribute.Key("messaging.operation")
- // The identifier for the consumer receiving a message. For Kafka, set it to
- // `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are
- // present, or only `messaging.kafka.consumer_group`. For brokers, such as
- // RabbitMQ and Artemis, set it to the `client_id` of the client consuming the
- // message.
+ // The message source name
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
- // Examples: 'mygroup - client-6'
- MessagingConsumerIDKey = attribute.Key("messaging.consumer_id")
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Source name SHOULD uniquely identify a specific queue, topic, or other
+ // entity within the broker. If
+ // the broker does not have such notion, the source name SHOULD uniquely identify
+ // the broker.
+ MessagingSourceNameKey = attribute.Key("messaging.source.name")
+ // The kind of message source
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceKindKey = attribute.Key("messaging.source.kind")
+ // Low cardinality representation of the messaging source name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Source names could be constructed from templates. An example would be a
+ // source name involving a user name or product id. Although the source name in
+ // this case is of high cardinality, the underlying template is of low cardinality
+ // and can be effectively used for grouping and aggregation.
+ MessagingSourceTemplateKey = attribute.Key("messaging.source.template")
+ // A boolean that is true if the message source is temporary and might not exist
+ // anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary")
+ // A boolean that is true if the message source is anonymous (could be unnamed or
+ // have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous")
)
var (
+ // A message received from a queue
+ MessagingSourceKindQueue = MessagingSourceKindKey.String("queue")
+ // A message received from a topic
+ MessagingSourceKindTopic = MessagingSourceKindKey.String("topic")
+)
+
+// This document defines general attributes used in messaging systems.
+const (
+ // A string identifying the messaging system.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS'
+ MessagingSystemKey = attribute.Key("messaging.system")
+ // A string identifying the kind of messaging operation as defined in the
+ // [Operation names](#operation-names) section above.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Note: If a custom value is used, it MUST be of low cardinality.
+ MessagingOperationKey = attribute.Key("messaging.operation")
+ // The number of messages sent, received, or processed in the scope of the
+ // batching operation.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the span describes an operation on
+ // a batch of messages.)
+ // Stability: stable
+ // Examples: 0, 1, 2
+ // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans
+ // that operate with a single message. When a messaging client library supports
+ // both batch and single-message API for the same operation, instrumentations
+ // SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use
+ // it for single-message APIs.
+ MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
+)
+
+var (
+ // publish
+ MessagingOperationPublish = MessagingOperationKey.String("publish")
// receive
MessagingOperationReceive = MessagingOperationKey.String("receive")
// process
MessagingOperationProcess = MessagingOperationKey.String("process")
)
+// Semantic convention for a consumer of messages received from a messaging system
+const (
+ // The identifier for the consumer receiving a message. For Kafka, set it to
+ // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both are
+ // present, or only `messaging.kafka.consumer.group`. For brokers, such as
+ // RabbitMQ and Artemis, set it to the `client_id` of the client consuming the
+ // message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'mygroup - client-6'
+ MessagingConsumerIDKey = attribute.Key("messaging.consumer.id")
+)
+
// Attributes for RabbitMQ
const (
// RabbitMQ message routing key.
//
// Type: string
- // Required: Unless it is empty.
+ // RequirementLevel: ConditionallyRequired (If not empty.)
// Stability: stable
// Examples: 'myKey'
- MessagingRabbitmqRoutingKeyKey = attribute.Key("messaging.rabbitmq.routing_key")
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
)
// Attributes for Apache Kafka
const (
// Message keys in Kafka are used for grouping alike messages to ensure they're
- // processed on the same partition. They differ from `messaging.message_id` in
+ // processed on the same partition. They differ from `messaging.message.id` in
// that they're not unique. If the key is `null`, the attribute MUST NOT be set.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'myKey'
// Note: If the key type is not string, it's string representation has to be
// supplied for the attribute. If the key has no unambiguous, canonical string
// form, don't include its value.
- MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message_key")
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
// Name of the Kafka Consumer Group that is handling the message. Only applies to
// consumers, not producers.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'my-group'
- MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer_group")
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
// Client ID for the Consumer or Producer that is handling the message.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'client-5'
MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
// Partition the message is sent to.
//
// Type: int
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 2
- MessagingKafkaPartitionKey = attribute.Key("messaging.kafka.partition")
+ MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
+ // Partition the message is received from.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2
+ MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition")
+ // The offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
// A boolean that is true if the message is a tombstone.
//
// Type: boolean
- // Required: If missing, it is assumed to be false.
+ // RequirementLevel: ConditionallyRequired (If value is `true`. When missing, the
+ // value is assumed to be `false`.)
// Stability: stable
- MessagingKafkaTombstoneKey = attribute.Key("messaging.kafka.tombstone")
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
)
// Attributes for Apache RocketMQ
@@ -1466,7 +1665,7 @@ const (
// individual.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'myNamespace'
MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
@@ -1474,41 +1673,67 @@ const (
// client type is identified by the SpanKind.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'myConsumerGroup'
MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
// The unique identifier for each client.
//
// Type: string
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'myhost@8742@s8083jm'
MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id")
+ // The timestamp in milliseconds that the delay message is expected to be
+ // delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay and delay
+ // time level is not specified.)
+ // Stability: stable
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+ // The delay time level for delay message, which determines the message delay
+ // time.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay and
+ // delivery timestamp is not specified.)
+ // Stability: stable
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+ // It is essential for FIFO message. Messages that belong to the same message
+ // group are always processed one by one within the same consumer group.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
+ // Stability: stable
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
// Type of message.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
- MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message_type")
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
// The secondary classifier of message besides topic.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'tagA'
- MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message_tag")
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
// Key(s) of message, another way to mark message besides message id.
//
// Type: string[]
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'keyA', 'keyB'
- MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message_keys")
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
// Model of message consumption. This only applies to consumer spans.
//
// Type: Enum
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
)
@@ -1537,14 +1762,14 @@ const (
// identifiers.
//
// Type: Enum
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
RPCSystemKey = attribute.Key("rpc.system")
// The full (logical) name of the service being called, including its package
// name, if applicable.
//
// Type: string
- // Required: No, but recommended
+ // RequirementLevel: Recommended
// Stability: stable
// Examples: 'myservice.EchoService'
// Note: This is the logical name of the service from the RPC interface
@@ -1558,7 +1783,7 @@ const (
// part in the span name.
//
// Type: string
- // Required: No, but recommended
+ // RequirementLevel: Recommended
// Stability: stable
// Examples: 'exampleMethod'
// Note: This is the logical name of the method from the RPC interface
@@ -1587,7 +1812,7 @@ const (
// request.
//
// Type: Enum
- // Required: Always
+ // RequirementLevel: Required
// Stability: stable
RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
)
@@ -1635,7 +1860,8 @@ const (
// 1.0 does not specify this, the value can be omitted.
//
// Type: string
- // Required: If missing, it is assumed to be "1.0".
+ // RequirementLevel: ConditionallyRequired (If other than the default version
+ // (`1.0`))
// Stability: stable
// Examples: '2.0', '1.0'
RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
@@ -1645,60 +1871,22 @@ const (
// if this is a notification.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: '10', 'request-7', ''
RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
// `error.code` property of response if it is an error response.
//
// Type: int
- // Required: If missing, response is assumed to be successful.
+ // RequirementLevel: ConditionallyRequired (If response is not successful.)
// Stability: stable
// Examples: -32700, 100
RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
// `error.message` property of response if it is an error response.
//
// Type: string
- // Required: No
+ // RequirementLevel: Optional
// Stability: stable
// Examples: 'Parse error', 'User already exists'
RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
)
-
-// RPC received/sent message.
-const (
- // Whether this is a received or sent message.
- //
- // Type: Enum
- // Required: No
- // Stability: stable
- MessageTypeKey = attribute.Key("message.type")
- // MUST be calculated as two different counters starting from `1` one for sent
- // messages and one for received message.
- //
- // Type: int
- // Required: No
- // Stability: stable
- // Note: This way we guarantee that the values will be consistent between
- // different implementations.
- MessageIDKey = attribute.Key("message.id")
- // Compressed size of the message in bytes.
- //
- // Type: int
- // Required: No
- // Stability: stable
- MessageCompressedSizeKey = attribute.Key("message.compressed_size")
- // Uncompressed size of the message in bytes.
- //
- // Type: int
- // Required: No
- // Stability: stable
- MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
-)
-
-var (
- // sent
- MessageTypeSent = MessageTypeKey.String("SENT")
- // received
- MessageTypeReceived = MessageTypeKey.String("RECEIVED")
-)
diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go
index 00b79bcc2..bda8f7cbf 100644
--- a/vendor/go.opentelemetry.io/otel/version.go
+++ b/vendor/go.opentelemetry.io/otel/version.go
@@ -16,5 +16,5 @@ package otel // import "go.opentelemetry.io/otel"
// Version is the current release version of OpenTelemetry in use.
func Version() string {
- return "1.11.2"
+ return "1.12.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml
index 611879def..66f456222 100644
--- a/vendor/go.opentelemetry.io/otel/versions.yaml
+++ b/vendor/go.opentelemetry.io/otel/versions.yaml
@@ -14,7 +14,7 @@
module-sets:
stable-v1:
- version: v1.11.2
+ version: v1.12.0
modules:
- go.opentelemetry.io/otel
- go.opentelemetry.io/otel/bridge/opentracing
@@ -34,7 +34,7 @@ module-sets:
- go.opentelemetry.io/otel/trace
- go.opentelemetry.io/otel/sdk
experimental-metrics:
- version: v0.34.0
+ version: v0.35.0
modules:
- go.opentelemetry.io/otel/example/opencensus
- go.opentelemetry.io/otel/example/prometheus
diff --git a/vendor/google.golang.org/api/internal/version.go b/vendor/google.golang.org/api/internal/version.go
index 2c1b8c1ab..2d02a441a 100644
--- a/vendor/google.golang.org/api/internal/version.go
+++ b/vendor/google.golang.org/api/internal/version.go
@@ -5,4 +5,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "0.108.0"
+const Version = "0.109.0"
diff --git a/vendor/modules.txt b/vendor/modules.txt
index a3147efe8..0af0d86a2 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -80,7 +80,7 @@ github.com/VividCortex/ewma
# github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
## explicit; go 1.15
github.com/alecthomas/units
-# github.com/aws/aws-sdk-go v1.44.189
+# github.com/aws/aws-sdk-go v1.44.190
## explicit; go 1.11
github.com/aws/aws-sdk-go/aws
github.com/aws/aws-sdk-go/aws/awserr
@@ -268,7 +268,7 @@ github.com/felixge/httpsnoop
## explicit; go 1.17
github.com/go-kit/log
github.com/go-kit/log/level
-# github.com/go-logfmt/logfmt v0.5.1
+# github.com/go-logfmt/logfmt v0.6.0
## explicit; go 1.17
github.com/go-logfmt/logfmt
# github.com/go-logr/logr v1.2.3
@@ -441,7 +441,7 @@ github.com/russross/blackfriday/v2
## explicit; go 1.13
github.com/stretchr/testify/assert
github.com/stretchr/testify/require
-# github.com/urfave/cli/v2 v2.24.1
+# github.com/urfave/cli/v2 v2.24.2
## explicit; go 1.18
github.com/urfave/cli/v2
# github.com/valyala/bytebufferpool v1.0.0
@@ -488,10 +488,10 @@ go.opencensus.io/trace
go.opencensus.io/trace/internal
go.opencensus.io/trace/propagation
go.opencensus.io/trace/tracestate
-# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0
+# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.38.0
## explicit; go 1.18
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
-# go.opentelemetry.io/otel v1.11.2
+# go.opentelemetry.io/otel v1.12.0
## explicit; go 1.18
go.opentelemetry.io/otel
go.opentelemetry.io/otel/attribute
@@ -502,20 +502,17 @@ go.opentelemetry.io/otel/internal/attribute
go.opentelemetry.io/otel/internal/baggage
go.opentelemetry.io/otel/internal/global
go.opentelemetry.io/otel/propagation
-go.opentelemetry.io/otel/semconv/internal
-go.opentelemetry.io/otel/semconv/v1.12.0
-# go.opentelemetry.io/otel/metric v0.34.0
+go.opentelemetry.io/otel/semconv/internal/v2
+go.opentelemetry.io/otel/semconv/v1.17.0
+go.opentelemetry.io/otel/semconv/v1.17.0/httpconv
+# go.opentelemetry.io/otel/metric v0.35.0
## explicit; go 1.18
go.opentelemetry.io/otel/metric
go.opentelemetry.io/otel/metric/global
go.opentelemetry.io/otel/metric/instrument
-go.opentelemetry.io/otel/metric/instrument/asyncfloat64
-go.opentelemetry.io/otel/metric/instrument/asyncint64
-go.opentelemetry.io/otel/metric/instrument/syncfloat64
-go.opentelemetry.io/otel/metric/instrument/syncint64
go.opentelemetry.io/otel/metric/internal/global
go.opentelemetry.io/otel/metric/unit
-# go.opentelemetry.io/otel/trace v1.11.2
+# go.opentelemetry.io/otel/trace v1.12.0
## explicit; go 1.18
go.opentelemetry.io/otel/trace
# go.uber.org/atomic v1.10.0
@@ -525,7 +522,7 @@ go.uber.org/atomic
## explicit; go 1.18
go.uber.org/goleak
go.uber.org/goleak/internal/stack
-# golang.org/x/exp v0.0.0-20230127193734-31bee513bff7
+# golang.org/x/exp v0.0.0-20230131160201-f062dba9d201
## explicit; go 1.18
golang.org/x/exp/constraints
golang.org/x/exp/slices
@@ -572,7 +569,7 @@ golang.org/x/time/rate
## explicit; go 1.17
golang.org/x/xerrors
golang.org/x/xerrors/internal
-# google.golang.org/api v0.108.0
+# google.golang.org/api v0.109.0
## explicit; go 1.19
google.golang.org/api/googleapi
google.golang.org/api/googleapi/transport
From dcc56161260437e8a8c3f990d88476a6d3d4aef2 Mon Sep 17 00:00:00 2001
From: Yury Molodov
Date: Tue, 31 Jan 2023 21:54:59 +0100
Subject: [PATCH 16/26] vmui: improvement the theme (#3731)
* feat: add detect the system theme
* fix: change logic fetch tenants
* feat: add docs and info to cardinality page
---------
Co-authored-by: Aliaksandr Valialkin
---
app/vmui/packages/vmui/src/App.tsx | 83 ++++++++--------
.../components/Chart/BarChart/BarChart.tsx | 4 +-
.../components/Chart/LineChart/LineChart.tsx | 4 +-
.../TenantsConfiguration.tsx | 5 +-
.../ThemeControl/ThemeControl.tsx | 34 +++----
.../Configurators/ThemeControl/style.scss | 42 +--------
.../TimeSelector/TimeSelector.tsx | 4 +-
.../src/components/Layout/Header/Header.tsx | 12 ++-
.../vmui/src/components/Main/Alert/Alert.tsx | 4 +-
.../Main/DatePicker/TImePicker/TimePicker.tsx | 4 +-
.../src/components/Main/Select/Select.tsx | 4 +-
.../src/components/Main/Spinner/Spinner.tsx | 34 ++++---
.../components/Main/TextField/TextField.tsx | 4 +-
.../Main/ThemeProvider/ThemeProvider.ts | 59 ++++++++----
.../src/components/Main/Toggle/Toggle.tsx | 94 +++++++++++++++++++
.../src/components/Main/Toggle/style.scss | 81 ++++++++++++++++
.../TraceQuery/NestedNav/NestedNav.tsx | 4 +-
.../packages/vmui/src/constants/palette.ts | 2 +-
.../packages/vmui/src/hooks/useSystemTheme.ts | 20 ++++
.../CardinalityConfigurator.tsx | 42 ++++++---
.../CardinalityConfigurator/style.scss | 19 ++--
.../vmui/src/pages/CardinalityPanel/index.tsx | 6 +-
app/vmui/packages/vmui/src/router/index.ts | 18 ++--
.../packages/vmui/src/state/common/reducer.ts | 22 +++--
.../vmui/src/styles/components/link.scss | 8 ++
app/vmui/packages/vmui/src/types/index.ts | 6 ++
app/vmui/packages/vmui/src/utils/storage.ts | 2 +-
app/vmui/packages/vmui/src/utils/theme.ts | 7 ++
28 files changed, 427 insertions(+), 201 deletions(-)
create mode 100644 app/vmui/packages/vmui/src/components/Main/Toggle/Toggle.tsx
create mode 100644 app/vmui/packages/vmui/src/components/Main/Toggle/style.scss
create mode 100644 app/vmui/packages/vmui/src/hooks/useSystemTheme.ts
diff --git a/app/vmui/packages/vmui/src/App.tsx b/app/vmui/packages/vmui/src/App.tsx
index 2f700f37f..331fb267c 100644
--- a/app/vmui/packages/vmui/src/App.tsx
+++ b/app/vmui/packages/vmui/src/App.tsx
@@ -8,56 +8,57 @@ import DashboardsLayout from "./pages/PredefinedPanels";
import CardinalityPanel from "./pages/CardinalityPanel";
import TopQueries from "./pages/TopQueries";
import ThemeProvider from "./components/Main/ThemeProvider/ThemeProvider";
-import Spinner from "./components/Main/Spinner/Spinner";
import TracePage from "./pages/TracePage";
import ExploreMetrics from "./pages/ExploreMetrics";
import PreviewIcons from "./components/Main/Icons/PreviewIcons";
const App: FC = () => {
- const [loadingTheme, setLoadingTheme] = useState(true);
+ const [loadedTheme, setLoadedTheme] = useState(false);
return <>
- {loadingTheme && }
-
-
-
+
-
- }
- >
- }
- />
- }
- />
- }
- />
- }
- />
- }
- />
- }
- />
- }
- />
-
-
+ <>
+
+ {loadedTheme && (
+
+ }
+ >
+ }
+ />
+ }
+ />
+ }
+ />
+ }
+ />
+ }
+ />
+ }
+ />
+ }
+ />
+
+
+ )}
+ >
>;
diff --git a/app/vmui/packages/vmui/src/components/Chart/BarChart/BarChart.tsx b/app/vmui/packages/vmui/src/components/Chart/BarChart/BarChart.tsx
index ef2d5ad36..6f1a7a465 100644
--- a/app/vmui/packages/vmui/src/components/Chart/BarChart/BarChart.tsx
+++ b/app/vmui/packages/vmui/src/components/Chart/BarChart/BarChart.tsx
@@ -9,7 +9,7 @@ const BarChart: FC = ({
data,
container,
configs }) => {
- const { darkTheme } = useAppState();
+ const { isDarkTheme } = useAppState();
const uPlotRef = useRef(null);
const [uPlotInst, setUPlotInst] = useState();
@@ -30,7 +30,7 @@ const BarChart: FC = ({
const u = new uPlot(options, data, uPlotRef.current);
setUPlotInst(u);
return u.destroy;
- }, [uPlotRef.current, layoutSize, darkTheme]);
+ }, [uPlotRef.current, layoutSize, isDarkTheme]);
useEffect(() => updateChart(), [data]);
diff --git a/app/vmui/packages/vmui/src/components/Chart/LineChart/LineChart.tsx b/app/vmui/packages/vmui/src/components/Chart/LineChart/LineChart.tsx
index af02f6850..c9d008f9c 100644
--- a/app/vmui/packages/vmui/src/components/Chart/LineChart/LineChart.tsx
+++ b/app/vmui/packages/vmui/src/components/Chart/LineChart/LineChart.tsx
@@ -48,7 +48,7 @@ const LineChart: FC = ({
container,
height
}) => {
- const { darkTheme } = useAppState();
+ const { isDarkTheme } = useAppState();
const uPlotRef = useRef(null);
const [isPanning, setPanning] = useState(false);
@@ -225,7 +225,7 @@ const LineChart: FC = ({
setUPlotInst(u);
setXRange({ min: period.start, max: period.end });
return u.destroy;
- }, [uPlotRef.current, series, layoutSize, height, darkTheme]);
+ }, [uPlotRef.current, series, layoutSize, height, isDarkTheme]);
useEffect(() => {
window.addEventListener("keydown", handleKeyDown);
diff --git a/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/TenantsConfiguration/TenantsConfiguration.tsx b/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/TenantsConfiguration/TenantsConfiguration.tsx
index bdcc7431d..2023aedf3 100644
--- a/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/TenantsConfiguration/TenantsConfiguration.tsx
+++ b/app/vmui/packages/vmui/src/components/Configurators/GlobalSettings/TenantsConfiguration/TenantsConfiguration.tsx
@@ -3,7 +3,6 @@ import { useAppDispatch, useAppState } from "../../../../state/common/StateConte
import { useTimeDispatch } from "../../../../state/time/TimeStateContext";
import { ArrowDownIcon, StorageIcons } from "../../../Main/Icons";
import Button from "../../../Main/Button/Button";
-import { useFetchAccountIds } from "./hooks/useFetchAccountIds";
import "./style.scss";
import { replaceTenantId } from "../../../../utils/default-server-url";
import classNames from "classnames";
@@ -11,13 +10,12 @@ import Popper from "../../../Main/Popper/Popper";
import { getAppModeEnable } from "../../../../utils/app-mode";
import Tooltip from "../../../Main/Tooltip/Tooltip";
-const TenantsConfiguration: FC = () => {
+const TenantsConfiguration: FC<{accountIds: string[]}> = ({ accountIds }) => {
const appModeEnable = getAppModeEnable();
const { tenantId: tenantIdState, serverUrl } = useAppState();
const dispatch = useAppDispatch();
const timeDispatch = useTimeDispatch();
- const { accountIds } = useFetchAccountIds();
const [openOptions, setOpenOptions] = useState(false);
const optionsButtonRef = useRef(null);
@@ -46,7 +44,6 @@ const TenantsConfiguration: FC = () => {
if (serverUrl) {
const updateServerUrl = replaceTenantId(serverUrl, tenant);
if (updateServerUrl === serverUrl) return;
- console.log("SET_SERVER", updateServerUrl);
dispatch({ type: "SET_SERVER", payload: updateServerUrl });
timeDispatch({ type: "RUN_QUERY" });
}
diff --git a/app/vmui/packages/vmui/src/components/Configurators/ThemeControl/ThemeControl.tsx b/app/vmui/packages/vmui/src/components/Configurators/ThemeControl/ThemeControl.tsx
index 76b48c5b7..e43cb828a 100644
--- a/app/vmui/packages/vmui/src/components/Configurators/ThemeControl/ThemeControl.tsx
+++ b/app/vmui/packages/vmui/src/components/Configurators/ThemeControl/ThemeControl.tsx
@@ -1,19 +1,16 @@
import React from "react";
import "./style.scss";
-import classNames from "classnames";
import { useAppDispatch, useAppState } from "../../../state/common/StateContext";
+import { Theme } from "../../../types";
+import Toggle from "../../Main/Toggle/Toggle";
-const options = [
- { title: "Light", value: false },
- { title: "Dark", value: true }
-];
-
+const options = Object.values(Theme).map(value => ({ title: value, value }));
const ThemeControl = () => {
- const { darkTheme } = useAppState();
+ const { theme } = useAppState();
const dispatch = useAppDispatch();
- const createHandlerClickItem = (value: boolean) => () => {
- dispatch({ type: "SET_DARK_THEME", payload: value });
+ const handleClickItem = (value: string) => {
+ dispatch({ type: "SET_THEME", payload: value as Theme });
};
return (
@@ -21,21 +18,12 @@ const ThemeControl = () => {