From d4ba510d8817bc05fd471f0eb71abb24480ad3b9 Mon Sep 17 00:00:00 2001 From: mattdurham Date: Wed, 27 Dec 2023 14:36:42 -0500 Subject: [PATCH 01/19] add max_cache_size (#6026) * add max_cache_size * add max_cache_size to converter * fix tests --- CHANGELOG.md | 2 ++ component/prometheus/relabel/relabel.go | 20 +++++++++++++------ component/prometheus/relabel/relabel_test.go | 14 ++++++++++++- .../prometheusconvert/component/relabel.go | 1 + .../components/prometheus.relabel.md | 3 ++- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 855f6dd398e6..73f81986a6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,8 @@ Main (unreleased) - Allows for pulling metrics at the Azure subscription level instead of resource by resource - Disable dimension validation by default to reduce the number of exporter instances needed for full dimension coverage +- Add `max_cache_size` to `prometheus.relabel` to allow configurability instead of hard coded 100,000. (@mattdurham) + ### Bugfixes - Update `pyroscope.ebpf` to fix a logical bug causing to profile to many kthreads instead of regular processes https://github.com/grafana/pyroscope/pull/2778 (@korniltsev) diff --git a/component/prometheus/relabel/relabel.go b/component/prometheus/relabel/relabel.go index c7b39ad6b0f4..0f3b0c6dc9ac 100644 --- a/component/prometheus/relabel/relabel.go +++ b/component/prometheus/relabel/relabel.go @@ -46,15 +46,23 @@ type Arguments struct { MetricRelabelConfigs []*flow_relabel.Config `river:"rule,block,optional"` // Cache size to use for LRU cache. - //CacheSize int `river:"cache_size,attr,optional"` + CacheSize int `river:"max_cache_size,attr,optional"` } // SetToDefault implements river.Defaulter. -/*func (arg *Arguments) SetToDefault() { +func (arg *Arguments) SetToDefault() { *arg = Arguments{ - CacheSize: 500_000, + CacheSize: 100_000, } -}*/ +} + +// Validate implements river.Validator. +func (arg *Arguments) Validate() error { + if arg.CacheSize <= 0 { + return fmt.Errorf("max_cache_size must be greater than 0 and is %d", arg.CacheSize) + } + return nil +} // Exports holds values which are exported by the prometheus.relabel component. type Exports struct { @@ -88,7 +96,7 @@ var ( // New creates a new prometheus.relabel component. func New(o component.Options, args Arguments) (*Component, error) { - cache, err := lru.New[uint64, *labelAndID](100_000) + cache, err := lru.New[uint64, *labelAndID](args.CacheSize) if err != nil { return nil, err } @@ -210,7 +218,7 @@ func (c *Component) Update(args component.Arguments) error { defer c.mut.Unlock() newArgs := args.(Arguments) - c.clearCache(100_000) + c.clearCache(newArgs.CacheSize) c.mrc = flow_relabel.ComponentToPromRelabelConfigs(newArgs.MetricRelabelConfigs) c.fanout.UpdateChildren(newArgs.ForwardTo) diff --git a/component/prometheus/relabel/relabel_test.go b/component/prometheus/relabel/relabel_test.go index c6d2b2699031..d029498555b8 100644 --- a/component/prometheus/relabel/relabel_test.go +++ b/component/prometheus/relabel/relabel_test.go @@ -44,11 +44,22 @@ func TestUpdateReset(t *testing.T) { relabeller.relabel(0, lbls) require.True(t, relabeller.cache.Len() == 1) _ = relabeller.Update(Arguments{ + CacheSize: 100000, MetricRelabelConfigs: []*flow_relabel.Config{}, }) require.True(t, relabeller.cache.Len() == 0) } +func TestValidator(t *testing.T) { + args := Arguments{CacheSize: 0} + err := args.Validate() + require.Error(t, err) + + args.CacheSize = 1 + err = args.Validate() + require.NoError(t, err) +} + func TestNil(t *testing.T) { ls := labelstore.New(nil, prom.DefaultRegisterer) fanout := prometheus.NewInterceptor(nil, ls, prometheus.WithAppendHook(func(ref storage.SeriesRef, _ labels.Labels, _ int64, _ float64, _ storage.Appender) (storage.SeriesRef, error) { @@ -72,6 +83,7 @@ func TestNil(t *testing.T) { Action: "drop", }, }, + CacheSize: 100000, }) require.NotNil(t, relabeller) require.NoError(t, err) @@ -129,7 +141,6 @@ func BenchmarkCache(b *testing.B) { lbls := labels.FromStrings("__address__", "localhost") app := entry.Appender(context.Background()) - for i := 0; i < b.N; i++ { app.Append(0, lbls, time.Now().UnixMilli(), 0) } @@ -161,6 +172,7 @@ func generateRelabel(t *testing.T) *Component { Action: "replace", }, }, + CacheSize: 100_000, }) require.NotNil(t, relabeller) require.NoError(t, err) diff --git a/converter/internal/prometheusconvert/component/relabel.go b/converter/internal/prometheusconvert/component/relabel.go index de6ec420ec21..a3bee3c6b7dd 100644 --- a/converter/internal/prometheusconvert/component/relabel.go +++ b/converter/internal/prometheusconvert/component/relabel.go @@ -36,6 +36,7 @@ func toRelabelArguments(relabelConfigs []*prom_relabel.Config, forwardTo []stora return &relabel.Arguments{ ForwardTo: forwardTo, MetricRelabelConfigs: ToFlowRelabelConfigs(relabelConfigs), + CacheSize: 100_000, } } diff --git a/docs/sources/flow/reference/components/prometheus.relabel.md b/docs/sources/flow/reference/components/prometheus.relabel.md index 93645aec83b6..65cb02394d4a 100644 --- a/docs/sources/flow/reference/components/prometheus.relabel.md +++ b/docs/sources/flow/reference/components/prometheus.relabel.md @@ -56,6 +56,7 @@ The following arguments are supported: Name | Type | Description | Default | Required ---- | ---- | ----------- | ------- | -------- `forward_to` | `list(MetricsReceiver)` | Where the metrics should be forwarded to, after relabeling takes place. | | yes +`max_cache_size` | `int` | The maximum number of elements to hold in the relabeling cache. | 100,000 | no ## Blocks @@ -187,4 +188,4 @@ connection work correctly. Refer to the linked documentation for more details. {{% /admonition %}} - \ No newline at end of file + From 373f79153a79cd3509478939d5fbab61d1ea74b0 Mon Sep 17 00:00:00 2001 From: Piotr <17101802+thampiotr@users.noreply.github.com> Date: Tue, 2 Jan 2024 14:09:59 +0100 Subject: [PATCH 02/19] Docs reorg: part 1 - add section definitions (#6031) --- docs/README.md | 11 ++--- docs/developer/writing-docs.md | 78 ++++++++++++++++++++++++++++++++++ docs/sources/flow/_index.md | 5 ++- 3 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 docs/developer/writing-docs.md diff --git a/docs/README.md b/docs/README.md index 3043ba188e8d..96b045920465 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,14 +1,15 @@ # Grafana Agent Documentation -This directory contains documentation for Grafana Agent. It is split into two -parts: +This directory contains documentation for Grafana Agent. It is split into the +following parts: -* `user/`: Documentation for users. This directory is hosted on - [grafana.com/docs/agent](https://grafana.com/docs/agent/latest/) and we - recommend interacting with it there instead of viewing the markdown on +* `sources/`: Source of user-facing documentation. This directory is hosted on + [grafana.com/docs/agent](https://grafana.com/docs/agent/latest/), and we + recommend viewing it there instead of the markdown on GitHub. * `developer/`: Documentation for contributors and maintainers. * `rfcs/`: RFCs for proposals relating to Grafana Agent. +* `generator/`: Code for generating some parts of the documentation. ## Preview the website diff --git a/docs/developer/writing-docs.md b/docs/developer/writing-docs.md new file mode 100644 index 000000000000..7cd9be07eed3 --- /dev/null +++ b/docs/developer/writing-docs.md @@ -0,0 +1,78 @@ +# Writing documentation + +This page is a collection of guidelines and best practices for writing +documentation for Grafana Agent. + +## Flow Mode documentation organisation + +The Flow mode documentation is organized into the following sections: + +### Get started + +The best place to start for new users who are onboarding. + +We showcase the features of the Agent and help users decide when to use Flow and +whether it's a good fit for them. + +This section includes how to quickly install the agent and get hands-on +experience with a simple "hello world" configuration. + +### Concepts + +As defined in the [writer's toolkit][]: + +> Provides an overview and background information. Answers the question “What is +> it?”. + +It helps users to learn the concepts of the Agent used throughout the +documentation. + +### Tutorials + +As defined in the [writer's toolkit][]: + +> Provides procedures that users can safely reproduce and learn from. Answers +> the question: “Can you teach me to …?” + +These are pages dedicated to learning. These are more broad, +while [Tasks](#tasks) are focused on one objective. Tutorials may use +non-production-ready examples to facilitate learning, while tasks are expected +to provide production-ready solutions. + +### Tasks + +As defined in the [writer's toolkit][]: + +> Provides numbered steps that describe how to achieve an outcome. Answers the +> question “How do I?”. + +However, in the Agent documentation we don't mandate the use of numbered steps. +We do expect that tasks allow users to achieve a specific outcome by following +the page step by step, but we don't require numbered steps because some tasks +branch out into multiple paths, and numbering the steps would look more +confusing. + +Tasks are production-ready and contain best practices and recommendations. They +are quite detailed, with Reference pages being the only type of documentation +that has more detail. + +Tasks should not be paraphrasing things which are already mentioned in the +Reference pages, such as default values and the meaning of the arguments. +Instead, they should link to relevant Reference pages. + +### Reference + +The Reference section is a collection of pages that describe the Agent +components and their configuration options exhaustively. This is a more narrow +definition than the one found in the [writer's toolkit][]. + +This is our most detailed documentation, and it should be used as a source of +truth. The contents of the Reference pages should not be repeated in other parts +of the documentation. + +### Release notes + +Release notes contain all the notable changes in the Agent. They are updated as +part of the release process. + +[writer's toolkit]: https://grafana.com/docs/writers-toolkit/structure/topic-types/ diff --git a/docs/sources/flow/_index.md b/docs/sources/flow/_index.md index df5e6ffdec8f..37fbf743da99 100644 --- a/docs/sources/flow/_index.md +++ b/docs/sources/flow/_index.md @@ -67,9 +67,10 @@ prometheus.remote_write "default" { } ``` -## {{% param "PRODUCT_ROOT_NAME" %}} configuration generator -The {{< param "PRODUCT_ROOT_NAME" >}} [configuration generator](https://grafana.github.io/agent-configurator/) will help you get a head start on creating flow code. +## {{< param "PRODUCT_NAME" >}} configuration generator + +The {{< param "PRODUCT_NAME" >}} [configuration generator](https://grafana.github.io/agent-configurator/) will help you get a head start on creating flow code. {{% admonition type="note" %}} This feature is experimental, and it doesn't support all River components. From 6ef7b8b1fd84236f8e01878249b2fc01029587a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20Tr=E1=BB=8Dng=20H=E1=BA=A3i?= <41283691+hainenber@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:35:00 +0700 Subject: [PATCH 03/19] feat(exporter/elasticsearch): add Basic Auth support (#5814) * feat(exporter/elasticsearch): add Basic Auth support Signed-off-by: hainenber * misc: fix changelog entry (#5812) PR #5802 accidentally added the changelog entry to a published release. * fix(exporter/elasticsearch): only add Auth header when needed Signed-off-by: hainenber * doc(exporter/elasticsearch): add Basic Auth block desc Signed-off-by: hainenber * feat(exporter/elasticsearch): add Basic Auth support Signed-off-by: hainenber * feat(exporter/elasticsearch): support Basic Auth for static config Signed-off-by: hainenber * chore(CHANGELOG): remove merge conflict artifact Signed-off-by: hainenber * misc: fix changelog entry Signed-off-by: hainenber * feat(converter): map ES exporter's BasicAuth flow from static to flow Signed-off-by: hainenber * fix(converter): nil check for ES exporter's Basic Auth Signed-off-by: hainenber * lint Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> --------- Signed-off-by: hainenber Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> Co-authored-by: Robert Fratto Co-authored-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> --- CHANGELOG.md | 2 + .../exporter/elasticsearch/elasticsearch.go | 37 +++++++------- .../elasticsearch/elasticsearch_test.go | 19 +++++++ .../internal/build/elasticsearch_exporter.go | 14 +++++- .../prometheus.exporter.elasticsearch.md | 19 +++++++ .../elasticsearch-exporter-config.md | 8 +++ .../elasticsearch_exporter.go | 50 +++++++++++++++++-- 7 files changed, 128 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f81986a6bd..70d52e74b987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ Main (unreleased) Previously, only `remote.*` and `local.*` components could be referenced without a circular dependency. (@rfratto) +- Add support for Basic Auth-secured connection with Elasticsearch cluster using `prometheus.exporter.elasticsearch`. (@hainenber) + - Add a `resource_to_telemetry_conversion` argument to `otelcol.exporter.prometheus` for converting resource attributes to Prometheus labels. (@hainenber) diff --git a/component/prometheus/exporter/elasticsearch/elasticsearch.go b/component/prometheus/exporter/elasticsearch/elasticsearch.go index 89123359cb9f..e09ed24c98d7 100644 --- a/component/prometheus/exporter/elasticsearch/elasticsearch.go +++ b/component/prometheus/exporter/elasticsearch/elasticsearch.go @@ -4,6 +4,7 @@ import ( "time" "github.com/grafana/agent/component" + commonCfg "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/component/prometheus/exporter" "github.com/grafana/agent/pkg/integrations" "github.com/grafana/agent/pkg/integrations/elasticsearch_exporter" @@ -35,23 +36,24 @@ var DefaultArguments = Arguments{ } type Arguments struct { - Address string `river:"address,attr,optional"` - Timeout time.Duration `river:"timeout,attr,optional"` - AllNodes bool `river:"all,attr,optional"` - Node string `river:"node,attr,optional"` - ExportIndices bool `river:"indices,attr,optional"` - ExportIndicesSettings bool `river:"indices_settings,attr,optional"` - ExportClusterSettings bool `river:"cluster_settings,attr,optional"` - ExportShards bool `river:"shards,attr,optional"` - IncludeAliases bool `river:"aliases,attr,optional"` - ExportSnapshots bool `river:"snapshots,attr,optional"` - ExportClusterInfoInterval time.Duration `river:"clusterinfo_interval,attr,optional"` - CA string `river:"ca,attr,optional"` - ClientPrivateKey string `river:"client_private_key,attr,optional"` - ClientCert string `river:"client_cert,attr,optional"` - InsecureSkipVerify bool `river:"ssl_skip_verify,attr,optional"` - ExportDataStreams bool `river:"data_stream,attr,optional"` - ExportSLM bool `river:"slm,attr,optional"` + Address string `river:"address,attr,optional"` + Timeout time.Duration `river:"timeout,attr,optional"` + AllNodes bool `river:"all,attr,optional"` + Node string `river:"node,attr,optional"` + ExportIndices bool `river:"indices,attr,optional"` + ExportIndicesSettings bool `river:"indices_settings,attr,optional"` + ExportClusterSettings bool `river:"cluster_settings,attr,optional"` + ExportShards bool `river:"shards,attr,optional"` + IncludeAliases bool `river:"aliases,attr,optional"` + ExportSnapshots bool `river:"snapshots,attr,optional"` + ExportClusterInfoInterval time.Duration `river:"clusterinfo_interval,attr,optional"` + CA string `river:"ca,attr,optional"` + ClientPrivateKey string `river:"client_private_key,attr,optional"` + ClientCert string `river:"client_cert,attr,optional"` + InsecureSkipVerify bool `river:"ssl_skip_verify,attr,optional"` + ExportDataStreams bool `river:"data_stream,attr,optional"` + ExportSLM bool `river:"slm,attr,optional"` + BasicAuth *commonCfg.BasicAuth `river:"basic_auth,block,optional"` } // SetToDefault implements river.Defaulter. @@ -78,5 +80,6 @@ func (a *Arguments) Convert() *elasticsearch_exporter.Config { InsecureSkipVerify: a.InsecureSkipVerify, ExportDataStreams: a.ExportDataStreams, ExportSLM: a.ExportSLM, + BasicAuth: a.BasicAuth.Convert(), } } diff --git a/component/prometheus/exporter/elasticsearch/elasticsearch_test.go b/component/prometheus/exporter/elasticsearch/elasticsearch_test.go index 3e87a5a98dc6..5c71a8ac712f 100644 --- a/component/prometheus/exporter/elasticsearch/elasticsearch_test.go +++ b/component/prometheus/exporter/elasticsearch/elasticsearch_test.go @@ -4,8 +4,11 @@ import ( "testing" "time" + commonCfg "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/pkg/integrations/elasticsearch_exporter" "github.com/grafana/river" + "github.com/grafana/river/rivertypes" + promCfg "github.com/prometheus/common/config" "github.com/stretchr/testify/require" ) @@ -27,6 +30,10 @@ func TestRiverUnmarshal(t *testing.T) { ssl_skip_verify = true data_stream = true slm = true + basic_auth { + username = "username" + password = "pass" + } ` var args Arguments @@ -50,6 +57,10 @@ func TestRiverUnmarshal(t *testing.T) { InsecureSkipVerify: true, ExportDataStreams: true, ExportSLM: true, + BasicAuth: &commonCfg.BasicAuth{ + Username: "username", + Password: rivertypes.Secret("pass"), + }, } require.Equal(t, expected, args) @@ -73,6 +84,10 @@ func TestConvert(t *testing.T) { ssl_skip_verify = true data_stream = true slm = true + basic_auth { + username = "username" + password = "pass" + } ` var args Arguments err := river.Unmarshal([]byte(riverConfig), &args) @@ -97,6 +112,10 @@ func TestConvert(t *testing.T) { InsecureSkipVerify: true, ExportDataStreams: true, ExportSLM: true, + BasicAuth: &promCfg.BasicAuth{ + Username: "username", + Password: promCfg.Secret("pass"), + }, } require.Equal(t, expected, *res) } diff --git a/converter/internal/staticconvert/internal/build/elasticsearch_exporter.go b/converter/internal/staticconvert/internal/build/elasticsearch_exporter.go index 97022a1f182f..67dda9e0285c 100644 --- a/converter/internal/staticconvert/internal/build/elasticsearch_exporter.go +++ b/converter/internal/staticconvert/internal/build/elasticsearch_exporter.go @@ -1,9 +1,11 @@ package build import ( + commonCfg "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/component/discovery" "github.com/grafana/agent/component/prometheus/exporter/elasticsearch" "github.com/grafana/agent/pkg/integrations/elasticsearch_exporter" + "github.com/grafana/river/rivertypes" ) func (b *IntegrationsConfigBuilder) appendElasticsearchExporter(config *elasticsearch_exporter.Config, instanceKey *string) discovery.Exports { @@ -12,7 +14,7 @@ func (b *IntegrationsConfigBuilder) appendElasticsearchExporter(config *elastics } func toElasticsearchExporter(config *elasticsearch_exporter.Config) *elasticsearch.Arguments { - return &elasticsearch.Arguments{ + arg := &elasticsearch.Arguments{ Address: config.Address, Timeout: config.Timeout, AllNodes: config.AllNodes, @@ -31,4 +33,14 @@ func toElasticsearchExporter(config *elasticsearch_exporter.Config) *elasticsear ExportDataStreams: config.ExportDataStreams, ExportSLM: config.ExportSLM, } + + if config.BasicAuth != nil { + arg.BasicAuth = &commonCfg.BasicAuth{ + Username: config.BasicAuth.Username, + Password: rivertypes.Secret(config.BasicAuth.Password), + PasswordFile: config.BasicAuth.PasswordFile, + } + } + + return arg } diff --git a/docs/sources/flow/reference/components/prometheus.exporter.elasticsearch.md b/docs/sources/flow/reference/components/prometheus.exporter.elasticsearch.md index fec1953dbef1..6feb9c683eeb 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.elasticsearch.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.elasticsearch.md @@ -56,6 +56,21 @@ Omitted fields take their default values. | `data_streams` | `bool` | Export stats for Data Streams. | | no | | `slm` | `bool` | Export stats for SLM (Snapshot Lifecycle Management). | | no | +## Blocks + +The following blocks are supported inside the definition of +`prometheus.exporter.elasticsearch`: + +| Hierarchy | Block | Description | Required | +| ------------------- | ----------------- | -------------------------------------------------------- | -------- | +| basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the endpoint. | no | + +[basic_auth]: #basic_auth-block + +### basic_auth block + +{{< docs/shared lookup="flow/reference/components/basic-auth-block.md" source="agent" version="" >}} + ## Exported fields {{< docs/shared lookup="flow/reference/components/exporter-component-exports.md" source="agent" version="" >}} @@ -84,6 +99,10 @@ from `prometheus.exporter.elasticsearch`: ```river prometheus.exporter.elasticsearch "example" { address = "http://localhost:9200" + basic_auth { + username = USERNAME + password = PASSWORD + } } // Configure a prometheus.scrape component to collect Elasticsearch metrics. diff --git a/docs/sources/static/configuration/integrations/elasticsearch-exporter-config.md b/docs/sources/static/configuration/integrations/elasticsearch-exporter-config.md index 22f26d4f15ad..9e0f3ee0f88b 100644 --- a/docs/sources/static/configuration/integrations/elasticsearch-exporter-config.md +++ b/docs/sources/static/configuration/integrations/elasticsearch-exporter-config.md @@ -116,4 +116,12 @@ Full reference of options: # Export stats for SLM (Snapshot Lifecycle Management). [ slm: ] + + # Sets the `Authorization` header on every ES probe with the + # configured username and password. + # password and password_file are mutually exclusive. + basic_auth: + [ username: ] + [ password: ] + [ password_file: ] ``` diff --git a/pkg/integrations/elasticsearch_exporter/elasticsearch_exporter.go b/pkg/integrations/elasticsearch_exporter/elasticsearch_exporter.go index d22fd2c618d8..d221a3521f72 100644 --- a/pkg/integrations/elasticsearch_exporter/elasticsearch_exporter.go +++ b/pkg/integrations/elasticsearch_exporter/elasticsearch_exporter.go @@ -4,9 +4,12 @@ package elasticsearch_exporter //nolint:golint import ( "context" + "encoding/base64" "fmt" "net/http" "net/url" + "os" + "strings" "time" "github.com/go-kit/log" @@ -15,6 +18,7 @@ import ( integrations_v2 "github.com/grafana/agent/pkg/integrations/v2" "github.com/grafana/agent/pkg/integrations/v2/metricsutils" "github.com/prometheus/client_golang/prometheus" + promCfg "github.com/prometheus/common/config" "github.com/prometheus-community/elasticsearch_exporter/collector" "github.com/prometheus-community/elasticsearch_exporter/pkg/clusterinfo" @@ -66,6 +70,21 @@ type Config struct { ExportDataStreams bool `yaml:"data_stream,omitempty"` // Export stats for Snapshot Lifecycle Management ExportSLM bool `yaml:"slm,omitempty"` + // BasicAuth block allows secure connection with Elasticsearch cluster via Basic-Auth + BasicAuth *promCfg.BasicAuth `yaml:"basic_auth,omitempty"` +} + +// Custom http.Transport struct for Basic Auth-secured communication with ES cluster +type BasicAuthHTTPTransport struct { + http.Transport + authHeader string +} + +func (b *BasicAuthHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) { + if b.authHeader != "" { + req.Header.Add("authorization", b.authHeader) + } + return b.Transport.RoundTrip(req) } // UnmarshalYAML implements yaml.Unmarshaler for Config @@ -115,14 +134,39 @@ func New(logger log.Logger, c *Config) (integrations.Integration, error) { // returns nil if not provided and falls back to simple TCP. tlsConfig := createTLSConfig(c.CA, c.ClientCert, c.ClientPrivateKey, c.InsecureSkipVerify) - httpClient := &http.Client{ - Timeout: c.Timeout, - Transport: &http.Transport{ + esHttpTransport := &BasicAuthHTTPTransport{ + Transport: http.Transport{ TLSClientConfig: tlsConfig, Proxy: http.ProxyFromEnvironment, }, } + if c.BasicAuth != nil { + password := string(c.BasicAuth.Password) + if len(c.BasicAuth.PasswordFile) > 0 { + buff, err := os.ReadFile(c.BasicAuth.PasswordFile) + if err != nil { + return nil, fmt.Errorf("unable to load password file %s: %w", c.BasicAuth.PasswordFile, err) + } + password = strings.TrimSpace(string(buff)) + } + username := c.BasicAuth.Username + if len(c.BasicAuth.UsernameFile) > 0 { + buff, err := os.ReadFile(c.BasicAuth.UsernameFile) + if err != nil { + return nil, fmt.Errorf("unable to load username file %s: %w", c.BasicAuth.UsernameFile, err) + } + username = strings.TrimSpace(string(buff)) + } + encodedAuth := base64.StdEncoding.EncodeToString([]byte(username + ":" + password)) + esHttpTransport.authHeader = "Basic " + encodedAuth + } + + httpClient := &http.Client{ + Timeout: c.Timeout, + Transport: esHttpTransport, + } + clusterInfoRetriever := clusterinfo.New(logger, httpClient, esURL, c.ExportClusterInfoInterval) collectors := []prometheus.Collector{ From 1cbeff4222ea5db7a427ded163d520a50961c324 Mon Sep 17 00:00:00 2001 From: Erik Baranowski <39704712+erikbaranowski@users.noreply.github.com> Date: Tue, 2 Jan 2024 12:35:14 -0500 Subject: [PATCH 04/19] Add support for http_sd_config within a scrape_config for the prometheus converter (#6038) Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> --- CHANGELOG.md | 2 + .../prometheusconvert/component/http.go | 43 +++++++++++ .../component/service_discovery.go | 6 ++ .../prometheusconvert/testdata/http.river | 72 +++++++++++++++++++ .../prometheusconvert/testdata/http.yaml | 34 +++++++++ 5 files changed, 157 insertions(+) create mode 100644 converter/internal/prometheusconvert/component/http.go create mode 100644 converter/internal/prometheusconvert/testdata/http.river create mode 100644 converter/internal/prometheusconvert/testdata/http.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 70d52e74b987..1db88fa58fe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ Main (unreleased) - Add `max_cache_size` to `prometheus.relabel` to allow configurability instead of hard coded 100,000. (@mattdurham) +- Add support for `http_sd_config` within a `scrape_config` for prometheus to flow config conversion. (@erikbaranowski) + ### Bugfixes - Update `pyroscope.ebpf` to fix a logical bug causing to profile to many kthreads instead of regular processes https://github.com/grafana/pyroscope/pull/2778 (@korniltsev) diff --git a/converter/internal/prometheusconvert/component/http.go b/converter/internal/prometheusconvert/component/http.go new file mode 100644 index 000000000000..5a6fde97fc1e --- /dev/null +++ b/converter/internal/prometheusconvert/component/http.go @@ -0,0 +1,43 @@ +package component + +import ( + "net/url" + "time" + + "github.com/grafana/agent/component/common/config" + "github.com/grafana/agent/component/discovery" + "github.com/grafana/agent/component/discovery/http" + "github.com/grafana/agent/converter/diag" + "github.com/grafana/agent/converter/internal/common" + "github.com/grafana/agent/converter/internal/prometheusconvert/build" + prom_http "github.com/prometheus/prometheus/discovery/http" +) + +func appendDiscoveryHttp(pb *build.PrometheusBlocks, label string, sdConfig *prom_http.SDConfig) discovery.Exports { + discoveryFileArgs := toDiscoveryHttp(sdConfig) + name := []string{"discovery", "http"} + block := common.NewBlockWithOverride(name, label, discoveryFileArgs) + pb.DiscoveryBlocks = append(pb.DiscoveryBlocks, build.NewPrometheusBlock(block, name, label, "", "")) + return common.NewDiscoveryExports("discovery.http." + label + ".targets") +} + +func ValidateDiscoveryHttp(sdConfig *prom_http.SDConfig) diag.Diagnostics { + return common.ValidateHttpClientConfig(&sdConfig.HTTPClientConfig) +} + +func toDiscoveryHttp(sdConfig *prom_http.SDConfig) *http.Arguments { + if sdConfig == nil { + return nil + } + + url, err := url.Parse(sdConfig.URL) + if err != nil { + panic("invalid http_sd_configs url provided") + } + + return &http.Arguments{ + HTTPClientConfig: *common.ToHttpClientConfig(&sdConfig.HTTPClientConfig), + RefreshInterval: time.Duration(sdConfig.RefreshInterval), + URL: config.URL{URL: url}, + } +} diff --git a/converter/internal/prometheusconvert/component/service_discovery.go b/converter/internal/prometheusconvert/component/service_discovery.go index 578c9f540fae..52780475e63a 100644 --- a/converter/internal/prometheusconvert/component/service_discovery.go +++ b/converter/internal/prometheusconvert/component/service_discovery.go @@ -9,6 +9,7 @@ import ( "github.com/grafana/agent/converter/internal/prometheusconvert/build" prom_discover "github.com/prometheus/prometheus/discovery" + prom_http "github.com/prometheus/prometheus/discovery/http" _ "github.com/prometheus/prometheus/discovery/install" // Register Prometheus SDs prom_aws "github.com/prometheus/prometheus/discovery/aws" @@ -60,6 +61,9 @@ func AppendServiceDiscoveryConfig(pb *build.PrometheusBlocks, serviceDiscoveryCo case *prom_gce.SDConfig: labelCounts["gce"]++ return appendDiscoveryGCE(pb, common.LabelWithIndex(labelCounts["gce"]-1, label), sdc) + case *prom_http.SDConfig: + labelCounts["http"]++ + return appendDiscoveryHttp(pb, common.LabelWithIndex(labelCounts["http"]-1, label), sdc) case *prom_kubernetes.SDConfig: labelCounts["kubernetes"]++ return appendDiscoveryKubernetes(pb, common.LabelWithIndex(labelCounts["kubernetes"]-1, label), sdc) @@ -121,6 +125,8 @@ func ValidateServiceDiscoveryConfig(serviceDiscoveryConfig prom_discover.Config) return ValidateDiscoveryFile(sdc) case *prom_gce.SDConfig: return ValidateDiscoveryGCE(sdc) + case *prom_http.SDConfig: + return ValidateDiscoveryHttp(sdc) case *prom_kubernetes.SDConfig: return ValidateDiscoveryKubernetes(sdc) case *prom_aws.LightsailSDConfig: diff --git a/converter/internal/prometheusconvert/testdata/http.river b/converter/internal/prometheusconvert/testdata/http.river new file mode 100644 index 000000000000..3184bf527e0d --- /dev/null +++ b/converter/internal/prometheusconvert/testdata/http.river @@ -0,0 +1,72 @@ +discovery.http "netbox_snmp" { + authorization { + type = "Token" + credentials_file = "/run/secrets/netbox_token" + } + follow_redirects = true + enable_http2 = true + refresh_interval = "15s" + url = "http://netbox:8080/api/plugins/prometheus-sd/devices?status=active&cf_prometheus_job=netbox_snmp" +} + +discovery.relabel "netbox_snmp" { + targets = discovery.http.netbox_snmp.targets + + rule { + source_labels = ["__meta_netbox_primary_ip"] + target_label = "instance" + } + + rule { + source_labels = ["__meta_netbox_site"] + target_label = "site" + } + + rule { + source_labels = ["__meta_netbox_location"] + target_label = "room" + } + + rule { + source_labels = ["__meta_netbox_name"] + target_label = "name" + } + + rule { + source_labels = ["instance"] + target_label = "__param_target" + } + + rule { + source_labels = ["__meta_netbox_custom_field_prometheus_snmp_module"] + target_label = "__param_module" + } + + rule { + source_labels = ["__meta_netbox_custom_field_prometheus_snmp_auth"] + target_label = "__param_auth" + } + + rule { + target_label = "__address__" + replacement = "snmp-exporter:9116" + } +} + +prometheus.scrape "netbox_snmp" { + targets = discovery.relabel.netbox_snmp.output + forward_to = [prometheus.remote_write.default.receiver] + job_name = "netbox_snmp" + metrics_path = "/snmp" +} + +prometheus.remote_write "default" { + endpoint { + name = "remote1" + url = "http://remote-write-url1" + + queue_config { } + + metadata_config { } + } +} diff --git a/converter/internal/prometheusconvert/testdata/http.yaml b/converter/internal/prometheusconvert/testdata/http.yaml new file mode 100644 index 000000000000..ca9e954db1b7 --- /dev/null +++ b/converter/internal/prometheusconvert/testdata/http.yaml @@ -0,0 +1,34 @@ +global: + scrape_interval: 60s + +scrape_configs: + - job_name: netbox_snmp + metrics_path: /snmp + http_sd_configs: + - url: http://netbox:8080/api/plugins/prometheus-sd/devices?status=active&cf_prometheus_job=netbox_snmp + refresh_interval: 15s + authorization: + type: Token + credentials_file: /run/secrets/netbox_token + relabel_configs: + - source_labels: [__meta_netbox_primary_ip] + target_label: instance + - source_labels: [__meta_netbox_site] + target_label: site + - source_labels: [__meta_netbox_location] + target_label: room + - source_labels: [__meta_netbox_name] + target_label: name + - source_labels: [instance] + target_label: __param_target + - source_labels: [__meta_netbox_custom_field_prometheus_snmp_module] + target_label: __param_module + - source_labels: [__meta_netbox_custom_field_prometheus_snmp_auth] + target_label: __param_auth + # replaces "address" with SNMP exporter's real hostname:port + - target_label: __address__ + replacement: snmp-exporter:9116 + +remote_write: + - name: "remote1" + url: "http://remote-write-url1" \ No newline at end of file From b1dd4994d632648896d2784c4f63bf4d62dad06b Mon Sep 17 00:00:00 2001 From: Craig Peterson <192540+captncraig@users.noreply.github.com> Date: Tue, 2 Jan 2024 13:38:01 -0500 Subject: [PATCH 05/19] Attach Agent ID to remote-write requests (#5999) * pull out agentseed package for reading and storing uuid. Also put it in data dir for flow. * add uid header to prometheus.remote_write and loki.write * init func * cleaner api with fewer edge cases * add to pyroscope * compile * add to static remote write * add to static mode loki write * remove return from write. we never need it. * move loki write out of convert function * move out of prometheus convert function * static prom, get out of defaults function * static logs: take out of defaults function * constant for header. Work done in init with sync.once. Hardening * added some tests * maybe fix tests * testmain? * changelog --- CHANGELOG.md | 2 + cmd/grafana-agent/entrypoint.go | 2 + cmd/internal/flowmode/cmd_run.go | 2 + component/loki/write/write.go | 8 + .../prometheus/remotewrite/remote_write.go | 8 + component/prometheus/remotewrite/types.go | 1 - component/pyroscope/write/write.go | 6 + internal/agentseed/agentseed.go | 149 ++++++++++++++++++ internal/agentseed/agentseed_test.go | 79 ++++++++++ pkg/logs/logs.go | 9 ++ pkg/metrics/instance/instance.go | 11 +- pkg/usagestats/reporter.go | 75 +-------- pkg/usagestats/stats.go | 3 +- 13 files changed, 278 insertions(+), 77 deletions(-) create mode 100644 internal/agentseed/agentseed.go create mode 100644 internal/agentseed/agentseed_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 1db88fa58fe6..3b83ee4d268c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,8 @@ Main (unreleased) - Bump github.com/IBM/sarama from v1.41.2 to v1.42.1 +- Attatch unique Agent ID header to remote-write requests. (@captncraig) + v0.38.1 (2023-11-30) -------------------- diff --git a/cmd/grafana-agent/entrypoint.go b/cmd/grafana-agent/entrypoint.go index c0b36845d330..172bbf8c58bb 100644 --- a/cmd/grafana-agent/entrypoint.go +++ b/cmd/grafana-agent/entrypoint.go @@ -17,6 +17,7 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/gorilla/mux" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/agent/pkg/config" "github.com/grafana/agent/pkg/logs" "github.com/grafana/agent/pkg/metrics" @@ -98,6 +99,7 @@ func NewEntrypoint(logger *server.Logger, cfg *config.Config, reloader Reloader) return nil, err } + agentseed.Init("", logger) ep.reporter, err = usagestats.NewReporter(logger) if err != nil { return nil, err diff --git a/cmd/internal/flowmode/cmd_run.go b/cmd/internal/flowmode/cmd_run.go index 4f319b61bb5a..c8618b928b85 100644 --- a/cmd/internal/flowmode/cmd_run.go +++ b/cmd/internal/flowmode/cmd_run.go @@ -18,6 +18,7 @@ import ( "github.com/grafana/agent/component" "github.com/grafana/agent/converter" convert_diag "github.com/grafana/agent/converter/diag" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/agent/pkg/boringcrypto" "github.com/grafana/agent/pkg/config/instrumentation" "github.com/grafana/agent/pkg/flow" @@ -248,6 +249,7 @@ func (fr *flowRun) Run(configPath string) error { } labelService := labelstore.New(l, reg) + agentseed.Init(fr.storagePath, l) f := flow.New(flow.Options{ Logger: l, diff --git a/component/loki/write/write.go b/component/loki/write/write.go index a31cb0745976..65fd04c6f692 100644 --- a/component/loki/write/write.go +++ b/component/loki/write/write.go @@ -12,6 +12,7 @@ import ( "github.com/grafana/agent/component/common/loki/client" "github.com/grafana/agent/component/common/loki/limit" "github.com/grafana/agent/component/common/loki/wal" + "github.com/grafana/agent/internal/agentseed" ) func init() { @@ -159,6 +160,13 @@ func (c *Component) Update(args component.Arguments) error { } cfgs := newArgs.convertClientConfigs() + uid := agentseed.Get().UID + for _, cfg := range cfgs { + if cfg.Headers == nil { + cfg.Headers = map[string]string{} + } + cfg.Headers[agentseed.HeaderName] = uid + } walCfg := wal.Config{ Enabled: newArgs.WAL.Enabled, MaxSegmentAge: newArgs.WAL.MaxSegmentAge, diff --git a/component/prometheus/remotewrite/remote_write.go b/component/prometheus/remotewrite/remote_write.go index e337ff8f8cca..354e3248450b 100644 --- a/component/prometheus/remotewrite/remote_write.go +++ b/component/prometheus/remotewrite/remote_write.go @@ -21,6 +21,7 @@ import ( "github.com/go-kit/log" "github.com/grafana/agent/component" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/agent/internal/useragent" "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/metrics/wal" @@ -257,6 +258,13 @@ func (c *Component) Update(newConfig component.Arguments) error { if err != nil { return err } + uid := agentseed.Get().UID + for _, cfg := range convertedConfig.RemoteWriteConfigs { + if cfg.Headers == nil { + cfg.Headers = map[string]string{} + } + cfg.Headers[agentseed.HeaderName] = uid + } err = c.remoteStore.ApplyConfig(convertedConfig) if err != nil { return err diff --git a/component/prometheus/remotewrite/types.go b/component/prometheus/remotewrite/types.go index 39ef6a55a191..473a2928e246 100644 --- a/component/prometheus/remotewrite/types.go +++ b/component/prometheus/remotewrite/types.go @@ -231,7 +231,6 @@ func convertConfigs(cfg Arguments) (*config.Config, error) { if err != nil { return nil, fmt.Errorf("cannot parse remote_write url %q: %w", rw.URL, err) } - rwConfigs = append(rwConfigs, &config.RemoteWriteConfig{ URL: &common.URL{URL: parsedURL}, RemoteTimeout: model.Duration(rw.RemoteTimeout), diff --git a/component/pyroscope/write/write.go b/component/pyroscope/write/write.go index 165a7f20a812..4c20797a611c 100644 --- a/component/pyroscope/write/write.go +++ b/component/pyroscope/write/write.go @@ -8,6 +8,7 @@ import ( "github.com/bufbuild/connect-go" "github.com/grafana/agent/component/pyroscope" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/agent/internal/useragent" "github.com/grafana/agent/pkg/flow/logging/level" "github.com/oklog/run" @@ -156,7 +157,12 @@ type fanOutClient struct { // NewFanOut creates a new fan out client that will fan out to all endpoints. func NewFanOut(opts component.Options, config Arguments, metrics *metrics) (*fanOutClient, error) { clients := make([]pushv1connect.PusherServiceClient, 0, len(config.Endpoints)) + uid := agentseed.Get().UID for _, endpoint := range config.Endpoints { + if endpoint.Headers == nil { + endpoint.Headers = map[string]string{} + } + endpoint.Headers[agentseed.HeaderName] = uid httpClient, err := commonconfig.NewClientFromConfig(*endpoint.HTTPClientConfig.Convert(), endpoint.Name) if err != nil { return nil, err diff --git a/internal/agentseed/agentseed.go b/internal/agentseed/agentseed.go new file mode 100644 index 000000000000..2405c732d9c5 --- /dev/null +++ b/internal/agentseed/agentseed.go @@ -0,0 +1,149 @@ +package agentseed + +import ( + "encoding/json" + "errors" + "os" + "path/filepath" + "runtime" + "sync" + "time" + + "github.com/go-kit/log" + "github.com/google/uuid" + "github.com/grafana/agent/pkg/flow/logging/level" + "github.com/prometheus/common/version" +) + +// AgentSeed identifies a unique agent +type AgentSeed struct { + UID string `json:"UID"` + CreatedAt time.Time `json:"created_at"` + Version string `json:"version"` +} + +const HeaderName = "X-Agent-Id" +const filename = "agent_seed.json" + +var savedSeed *AgentSeed +var once sync.Once + +// Init should be called by an app entrypoint as soon as it can to configure where the unique seed will be stored. +// dir is the directory where we will read and store agent_seed.json +// If left empty it will default to $APPDATA or /tmp +// A unique agent seed will be generated when this method is first called, and reused for the lifetime of this agent. +func Init(dir string, l log.Logger) { + if l == nil { + l = log.NewNopLogger() + } + once.Do(func() { + loadOrGenerate(dir, l) + }) +} + +func loadOrGenerate(dir string, l log.Logger) { + var err error + var seed *AgentSeed + // list of paths in preference order. + // we will always write to the first path + paths := []string{} + if dir != "" { + paths = append(paths, filepath.Join(dir, filename)) + } + paths = append(paths, legacyPath()) + defer func() { + // as a fallback, gen and save a new uid + if seed == nil || seed.UID == "" { + seed = generateNew() + writeSeedFile(seed, paths[0], l) + } + // Finally save seed + savedSeed = seed + }() + for i, p := range paths { + if fileExists(p) { + if seed, err = readSeedFile(p, l); err == nil { + if i == 0 { + // we found it at the preferred path. Just return it + return + } else { + // it was at a backup path. write it to the preferred path. + writeSeedFile(seed, paths[0], l) + return + } + } + } + } +} + +func generateNew() *AgentSeed { + return &AgentSeed{ + UID: uuid.NewString(), + Version: version.Version, + CreatedAt: time.Now(), + } +} + +// Get will return a unique agent seed for this agent. +// It will always return a valid seed, even if previous attempts to +// load or save the seed file have failed +func Get() *AgentSeed { + // Init should have been called before this. If not, call it now with defaults. + once.Do(func() { + loadOrGenerate("", log.NewNopLogger()) + }) + if savedSeed != nil { + return savedSeed + } + // we should never get here. But if somehow we do, + // still return a valid seed for this request only + return generateNew() +} + +// readSeedFile reads the agent seed file +func readSeedFile(path string, logger log.Logger) (*AgentSeed, error) { + data, err := os.ReadFile(path) + if err != nil { + level.Error(logger).Log("msg", "Reading seed file", "err", err) + return nil, err + } + seed := &AgentSeed{} + err = json.Unmarshal(data, seed) + if err != nil { + level.Error(logger).Log("msg", "Decoding seed file", "err", err) + return nil, err + } + + if seed.UID == "" { + level.Error(logger).Log("msg", "Seed file has empty uid") + } + return seed, nil +} + +func legacyPath() string { + // windows + if runtime.GOOS == "windows" { + return filepath.Join(os.Getenv("APPDATA"), filename) + } + // linux/mac + return filepath.Join("/tmp", filename) +} + +func fileExists(path string) bool { + _, err := os.Stat(path) + return !errors.Is(err, os.ErrNotExist) +} + +// writeSeedFile writes the agent seed file +func writeSeedFile(seed *AgentSeed, path string, logger log.Logger) { + data, err := json.Marshal(*seed) + if err != nil { + level.Error(logger).Log("msg", "Encoding seed file", "err", err) + return + } + err = os.WriteFile(path, data, 0644) + if err != nil { + level.Error(logger).Log("msg", "Writing seed file", "err", err) + return + } +} diff --git a/internal/agentseed/agentseed_test.go b/internal/agentseed/agentseed_test.go new file mode 100644 index 000000000000..91650c59e7d1 --- /dev/null +++ b/internal/agentseed/agentseed_test.go @@ -0,0 +1,79 @@ +package agentseed + +import ( + "os" + "path/filepath" + "sync" + "testing" + + "github.com/go-kit/log" + "github.com/stretchr/testify/require" +) + +func TestMain(m *testing.M) { + os.Remove(legacyPath()) + exitVal := m.Run() + os.Exit(exitVal) +} + +func reset() { + os.Remove(legacyPath()) + savedSeed = nil + once = sync.Once{} +} + +func TestNoExistingFile(t *testing.T) { + t.Cleanup(reset) + dir := t.TempDir() + l := log.NewNopLogger() + f := filepath.Join(dir, filename) + require.NoFileExists(t, f) + Init(dir, l) + require.FileExists(t, f) + loaded, err := readSeedFile(f, l) + require.NoError(t, err) + seed := Get() + require.Equal(t, seed.UID, loaded.UID) +} + +func TestExistingFile(t *testing.T) { + t.Cleanup(reset) + dir := t.TempDir() + l := log.NewNopLogger() + f := filepath.Join(dir, filename) + seed := generateNew() + writeSeedFile(seed, f, l) + Init(dir, l) + require.NotNil(t, savedSeed) + require.Equal(t, seed.UID, savedSeed.UID) + require.Equal(t, seed.UID, Get().UID) +} + +func TestNoInitCalled(t *testing.T) { + t.Cleanup(reset) + l := log.NewNopLogger() + seed := Get() + require.NotNil(t, seed) + f := legacyPath() + require.FileExists(t, f) + loaded, err := readSeedFile(f, l) + require.NoError(t, err) + require.Equal(t, seed.UID, loaded.UID) +} + +func TestLegacyExists(t *testing.T) { + t.Cleanup(reset) + dir := t.TempDir() + l := log.NewNopLogger() + f := filepath.Join(dir, filename) + seed := generateNew() + writeSeedFile(seed, legacyPath(), l) + Init(dir, l) + require.FileExists(t, f) + require.NotNil(t, savedSeed) + require.Equal(t, seed.UID, savedSeed.UID) + require.Equal(t, seed.UID, Get().UID) + loaded, err := readSeedFile(f, l) + require.NoError(t, err) + require.Equal(t, seed.UID, loaded.UID) +} diff --git a/pkg/logs/logs.go b/pkg/logs/logs.go index a821298be9fd..118c1a75bf58 100644 --- a/pkg/logs/logs.go +++ b/pkg/logs/logs.go @@ -11,6 +11,7 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/agent/internal/useragent" "github.com/grafana/agent/pkg/util" "github.com/grafana/loki/clients/pkg/promtail" @@ -183,6 +184,14 @@ func (i *Instance) ApplyConfig(c *InstanceConfig, g GlobalConfig, dryRun bool) e return nil } + uid := agentseed.Get().UID + for _, cfg := range c.ClientConfigs { + if cfg.Headers == nil { + cfg.Headers = map[string]string{} + } + cfg.Headers[agentseed.HeaderName] = uid + } + clientMetrics := client.NewMetrics(i.reg) cfg := DefaultConfig() cfg.Global = config.GlobalConfig{ diff --git a/pkg/metrics/instance/instance.go b/pkg/metrics/instance/instance.go index 3d0e9fd47ca7..eae93936be2f 100644 --- a/pkg/metrics/instance/instance.go +++ b/pkg/metrics/instance/instance.go @@ -17,6 +17,7 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/agent/internal/useragent" "github.com/grafana/agent/pkg/metrics/wal" "github.com/grafana/agent/pkg/util" @@ -157,7 +158,6 @@ func (c *Config) ApplyDefaults(global GlobalConfig) error { } rwNames := map[string]struct{}{} - // If the instance remote write is not filled in, then apply the prometheus write config if len(c.RemoteWrite) == 0 { c.RemoteWrite = c.global.RemoteWrite @@ -166,7 +166,6 @@ func (c *Config) ApplyDefaults(global GlobalConfig) error { if cfg == nil { return fmt.Errorf("empty or null remote write config section") } - // Typically Prometheus ignores empty names here, but we need to assign a // unique name to the config so we can pull metrics from it when running // an instance. @@ -183,7 +182,6 @@ func (c *Config) ApplyDefaults(global GlobalConfig) error { cfg.Name = c.Name + "-" + hash[:6] generatedName = true } - if _, exists := rwNames[cfg.Name]; exists { if generatedName { return fmt.Errorf("found two identical remote_write configs") @@ -419,6 +417,13 @@ func (i *Instance) initialize(ctx context.Context, reg prometheus.Registerer, cf // Set up the remote storage remoteLogger := log.With(i.logger, "component", "remote") i.remoteStore = remote.NewStorage(remoteLogger, reg, i.wal.StartTime, i.wal.Directory(), cfg.RemoteFlushDeadline, i.readyScrapeManager) + uid := agentseed.Get().UID + for _, rw := range cfg.RemoteWrite { + if rw.Headers == nil { + rw.Headers = map[string]string{} + } + rw.Headers[agentseed.HeaderName] = uid + } err = i.remoteStore.ApplyConfig(&config.Config{ GlobalConfig: cfg.global.Prometheus, RemoteWriteConfigs: cfg.RemoteWrite, diff --git a/pkg/usagestats/reporter.go b/pkg/usagestats/reporter.go index 2c1ac8fa43ba..a175e154b92a 100644 --- a/pkg/usagestats/reporter.go +++ b/pkg/usagestats/reporter.go @@ -2,20 +2,14 @@ package usagestats import ( "context" - "encoding/json" - "errors" "math" - "os" - "path/filepath" - "runtime" "time" "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/google/uuid" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/dskit/backoff" "github.com/grafana/dskit/multierror" - "github.com/prometheus/common/version" ) var ( @@ -27,17 +21,10 @@ var ( type Reporter struct { logger log.Logger - agentSeed *AgentSeed + agentSeed *agentseed.AgentSeed lastReport time.Time } -// AgentSeed identifies a unique agent -type AgentSeed struct { - UID string `json:"UID"` - CreatedAt time.Time `json:"created_at"` - Version string `json:"version"` -} - // NewReporter creates a Reporter that will send periodically reports to grafana.com func NewReporter(logger log.Logger) (*Reporter, error) { r := &Reporter{ @@ -46,66 +33,10 @@ func NewReporter(logger log.Logger) (*Reporter, error) { return r, nil } -func (rep *Reporter) init(ctx context.Context) error { - path := agentSeedFileName() - - if fileExists(path) { - seed, err := rep.readSeedFile(path) - rep.agentSeed = seed - return err - } - rep.agentSeed = &AgentSeed{ - UID: uuid.NewString(), - Version: version.Version, - CreatedAt: time.Now(), - } - return rep.writeSeedFile(*rep.agentSeed, path) -} - -func fileExists(path string) bool { - _, err := os.Stat(path) - return !errors.Is(err, os.ErrNotExist) -} - -// readSeedFile reads the agent seed file -func (rep *Reporter) readSeedFile(path string) (*AgentSeed, error) { - data, err := os.ReadFile(path) - if err != nil { - return nil, err - } - seed := &AgentSeed{} - err = json.Unmarshal(data, seed) - if err != nil { - return nil, err - } - return seed, nil -} - -// writeSeedFile writes the agent seed file -func (rep *Reporter) writeSeedFile(seed AgentSeed, path string) error { - data, err := json.Marshal(seed) - if err != nil { - return err - } - return os.WriteFile(path, data, 0644) -} - -func agentSeedFileName() string { - if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("APPDATA"), "agent_seed.json") - } - // linux/mac - return "/tmp/agent_seed.json" -} - // Start inits the reporter seed and start sending report for every interval func (rep *Reporter) Start(ctx context.Context, metricsFunc func() map[string]interface{}) error { level.Info(rep.logger).Log("msg", "running usage stats reporter") - err := rep.init(ctx) - if err != nil { - level.Info(rep.logger).Log("msg", "failed to init seed", "err", err) - return err - } + rep.agentSeed = agentseed.Get() // check every minute if we should report. ticker := time.NewTicker(reportCheckInterval) diff --git a/pkg/usagestats/stats.go b/pkg/usagestats/stats.go index d3418a5c4bde..004bc6e6d0e6 100644 --- a/pkg/usagestats/stats.go +++ b/pkg/usagestats/stats.go @@ -10,6 +10,7 @@ import ( "runtime" "time" + "github.com/grafana/agent/internal/agentseed" "github.com/grafana/agent/internal/useragent" "github.com/prometheus/common/version" ) @@ -31,7 +32,7 @@ type Report struct { DeployMode string `json:"deployMode"` } -func sendReport(ctx context.Context, seed *AgentSeed, interval time.Time, metrics map[string]interface{}) error { +func sendReport(ctx context.Context, seed *agentseed.AgentSeed, interval time.Time, metrics map[string]interface{}) error { report := Report{ UsageStatsID: seed.UID, CreatedAt: seed.CreatedAt, From 4171583c76a472672d80eb7b4a0ee17df9793c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20Tr=E1=BB=8Dng=20H=E1=BA=A3i?= <41283691+hainenber@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:50:24 +0700 Subject: [PATCH 06/19] chore(doc): add missing double quote (#6019) Signed-off-by: hainenber --- .../flow/reference/components/otelcol.processor.filter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/flow/reference/components/otelcol.processor.filter.md b/docs/sources/flow/reference/components/otelcol.processor.filter.md index 80e237c885aa..1912ad4ab1a1 100644 --- a/docs/sources/flow/reference/components/otelcol.processor.filter.md +++ b/docs/sources/flow/reference/components/otelcol.processor.filter.md @@ -212,7 +212,7 @@ otelcol.processor.filter "default" { traces { span = [ - "attributes[\"container.name\"] == \"app_container_1\", + "attributes[\"container.name\"] == \"app_container_1\"", ] } From 058695a135d3b9ec1963abacada03106f45a34a0 Mon Sep 17 00:00:00 2001 From: Piotr <17101802+thampiotr@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:44:39 +0100 Subject: [PATCH 07/19] Move "configuration language" section to "concepts" (#6033) * Move 'configuration language' section to 'concepts' * fix relative aliases * add aliases of the deleted page * add missing alias --- docs/sources/flow/_index.md | 2 - .../flow/concepts/config-language/_index.md | 147 ++++++++++++++++++ .../config-language/components.md | 14 +- .../config-language/expressions/_index.md | 22 ++- .../expressions/function_calls.md | 10 +- .../config-language/expressions/operators.md | 10 +- .../expressions/referencing_exports.md | 14 +- .../expressions/types_and_values.md | 12 +- .../{ => concepts}/config-language/files.md | 10 +- .../{ => concepts}/config-language/syntax.md | 18 ++- .../flow/concepts/configuration_language.md | 96 ------------ docs/sources/flow/config-language/_index.md | 79 ---------- .../collect-prometheus-metrics.md | 4 +- .../migrating-from-prometheus.md | 4 +- .../migrating-from-promtail.md | 4 +- .../getting-started/migrating-from-static.md | 4 +- docs/sources/flow/monitoring/debugging.md | 4 +- .../flow/reference/compatibility/_index.md | 10 +- .../flow/reference/components/local.file.md | 2 +- .../flow/reference/components/module.file.md | 2 +- .../flow/reference/components/module.http.md | 2 +- .../components/otelcol.processor.filter.md | 2 +- .../components/otelcol.processor.transform.md | 8 +- .../flow/reference/components/remote.http.md | 2 +- .../flow/reference/components/remote.s3.md | 2 +- .../flow/reference/stdlib/nonsensitive.md | 2 +- .../collecting-prometheus-metrics.md | 4 +- 27 files changed, 254 insertions(+), 236 deletions(-) create mode 100644 docs/sources/flow/concepts/config-language/_index.md rename docs/sources/flow/{ => concepts}/config-language/components.md (82%) rename docs/sources/flow/{ => concepts}/config-language/expressions/_index.md (51%) rename docs/sources/flow/{ => concepts}/config-language/expressions/function_calls.md (63%) rename docs/sources/flow/{ => concepts}/config-language/expressions/operators.md (84%) rename docs/sources/flow/{ => concepts}/config-language/expressions/referencing_exports.md (68%) rename docs/sources/flow/{ => concepts}/config-language/expressions/types_and_values.md (90%) rename docs/sources/flow/{ => concepts}/config-language/files.md (53%) rename docs/sources/flow/{ => concepts}/config-language/syntax.md (81%) delete mode 100644 docs/sources/flow/concepts/configuration_language.md delete mode 100644 docs/sources/flow/config-language/_index.md diff --git a/docs/sources/flow/_index.md b/docs/sources/flow/_index.md index 37fbf743da99..7458fd016b03 100644 --- a/docs/sources/flow/_index.md +++ b/docs/sources/flow/_index.md @@ -82,7 +82,6 @@ This feature is experimental, and it doesn't support all River components. * Learn about the core [Concepts][] of {{< param "PRODUCT_NAME" >}}. * Follow our [Getting started][] guides for {{< param "PRODUCT_NAME" >}}. * Follow our [Tutorials][] to get started with {{< param "PRODUCT_NAME" >}}. -* Learn how to use the [Configuration language][]. * Check out our [Reference][] documentation to find specific information you might be looking for. @@ -90,6 +89,5 @@ This feature is experimental, and it doesn't support all River components. [Concepts]: {{< relref "./concepts/" >}} [Getting started]: {{< relref "./getting-started/" >}} [Tutorials]: {{< relref "./tutorials/ ">}} -[Configuration language]: {{< relref "./config-language/" >}} [Reference]: {{< relref "./reference" >}} diff --git a/docs/sources/flow/concepts/config-language/_index.md b/docs/sources/flow/concepts/config-language/_index.md new file mode 100644 index 000000000000..80699732f3ac --- /dev/null +++ b/docs/sources/flow/concepts/config-language/_index.md @@ -0,0 +1,147 @@ +--- +aliases: +- /docs/grafana-cloud/agent/flow/concepts/config-language/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/ +- configuration-language/ # /docs/agent/latest/flow/concepts/configuration-language/ +# Previous page aliases for backwards compatibility: +- /docs/grafana-cloud/agent/flow/config-language/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/ +- /docs/grafana-cloud/send-data/agent/flow/config-language/ +- ../configuration-language/ # /docs/agent/latest/flow/configuration-language/ +- ../concepts/configuration_language/ # /docs/agent/latest/flow/concepts/configuration_language/ +- /docs/grafana-cloud/agent/flow/concepts/configuration_language/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/configuration_language/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/configuration_language/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/configuration_language/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/ +description: Learn about the configuration language +title: Configuration language +weight: 10 +--- + +# Configuration language + +{{< param "PRODUCT_NAME" >}} dynamically configures and connects components with a custom configuration language called River. + +River aims to reduce errors in configuration files by making configurations easier to read and write. +River configurations use blocks that can be easily copied and pasted from the documentation to help you get started as quickly as possible. + +A River configuration file tells {{< param "PRODUCT_NAME" >}} which components to launch and how to bind them together into a pipeline. + +The River syntax uses blocks, attributes, and expressions. + +```river +// Create a local.file component labeled my_file. +// This can be referenced by other components as local.file.my_file. +local.file "my_file" { + filename = "/tmp/my-file.txt" +} + +// Pattern for creating a labeled block, which the above block follows: +BLOCK_NAME "BLOCK_LABEL" { + // Block body + IDENTIFIER = EXPRESSION // Attribute +} + +// Pattern for creating an unlabeled block: +BLOCK_NAME { + // Block body + IDENTIFIER = EXPRESSION // Attribute +} +``` + +[River is designed][RFC] with the following requirements in mind: + +* _Fast_: The configuration language must be fast so the component controller can quickly evaluate changes. +* _Simple_: The configuration language must be easy to read and write to minimize the learning curve. +* _Debuggable_: The configuration language must give detailed information when there's a mistake in the configuration file. + +River is similar to HCL, the language Terraform and other Hashicorp projects use. +It's a distinct language with custom syntax and features, such as first-class functions. + +* Blocks are a group of related settings and usually represent creating a component. + Blocks have a name that consists of zero or more identifiers separated by `.`, an optional user label, and a body containing attributes and nested blocks. +* Attributes appear within blocks and assign a value to a name. +* Expressions represent a value, either literally or by referencing and combining other values. + You use expressions to compute a value for an attribute. + +River is declarative, so ordering components, blocks, and attributes within a block isn't significant. +The relationship between components determines the order of operations. + +## Attributes + +You use _Attributes_ to configure individual settings. +Attributes always take the form of `ATTRIBUTE_NAME = ATTRIBUTE_VALUE`. + +The following example shows how to set the `log_level` attribute to `"debug"`. + +```river +log_level = "debug" +``` + +## Expressions + +You use expressions to compute the value of an attribute. +The simplest expressions are constant values like `"debug"`, `32`, or `[1, 2, 3, 4]`. +River supports complex expressions, for example: + +* Referencing the exports of components: `local.file.password_file.content` +* Mathematical operations: `1 + 2`, `3 * 4`, `(5 * 6) + (7 + 8)` +* Equality checks: `local.file.file_a.content == local.file.file_b.content` +* Calling functions from River's standard library: `env("HOME")` retrieves the value of the `HOME` environment variable. + +You can use expressions for any attribute inside a component definition. + +### Referencing component exports + +The most common expression is to reference the exports of a component, for example, `local.file.password_file.content`. +You form a reference to a component's exports by merging the component's name (for example, `local.file`), +label (for example, `password_file`), and export name (for example, `content`), delimited by a period. + +## Blocks + +You use _Blocks_ to configure components and groups of attributes. +Each block can contain any number of attributes or nested blocks. + +```river +prometheus.remote_write "default" { + endpoint { + url = "http://localhost:9009/api/prom/push" + } +} +``` + +The preceding example has two blocks: + +* `prometheus.remote_write "default"`: A labeled block which instantiates a `prometheus.remote_write` component. + The label is the string `"default"`. +* `endpoint`: An unlabeled block inside the component that configures an endpoint to send metrics to. + This block sets the `url` attribute to specify the endpoint. + + +## Tooling + +You can use one or all of the following tools to help you write configuration files in River. + +* Experimental editor support for + * [vim](https://github.com/rfratto/vim-river) + * [VSCode](https://github.com/rfratto/vscode-river) + * [river-mode](https://github.com/jdbaldry/river-mode) for Emacs +* Code formatting using the [`agent fmt` command][fmt] + +You can also start developing your own tooling using the {{< param "PRODUCT_ROOT_NAME" >}} repository as a go package or use the +[tree-sitter grammar][] with other programming languages. + +[RFC]: https://github.com/grafana/agent/blob/97a55d0d908b26dbb1126cc08b6dcc18f6e30087/docs/rfcs/0005-river.md +[vim]: https://github.com/rfratto/vim-river +[VSCode]: https://github.com/rfratto/vscode-river +[river-mode]: https://github.com/jdbaldry/river-mode +[tree-sitter grammar]: https://github.com/grafana/tree-sitter-river + +{{% docs/reference %}} +[fmt]: "/docs/agent/ -> /docs/agent//flow/reference/cli/fmt" +[fmt]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/cli/fmt" +{{% /docs/reference %}} \ No newline at end of file diff --git a/docs/sources/flow/config-language/components.md b/docs/sources/flow/concepts/config-language/components.md similarity index 82% rename from docs/sources/flow/config-language/components.md rename to docs/sources/flow/concepts/config-language/components.md index 3939363ba7a5..967d2437da8c 100644 --- a/docs/sources/flow/config-language/components.md +++ b/docs/sources/flow/concepts/config-language/components.md @@ -1,11 +1,17 @@ --- aliases: -- ../configuration-language/components/ +- ../configuration-language/components/ # /docs/agent/latest/flow/concepts/configuration-language/components/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/components/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/components/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/components/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/components/ +# Previous page aliases for backwards compatibility: +- ../../configuration-language/components/ # /docs/agent/latest/flow/configuration-language/components/ - /docs/grafana-cloud/agent/flow/config-language/components/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/components/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/components/ - /docs/grafana-cloud/send-data/agent/flow/config-language/components/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/components/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/components/ description: Learn about the components configuration language title: Components configuration language weight: 300 @@ -93,6 +99,6 @@ The value is type-checked and substituted into `prometheus.scrape.default`, wher [components]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/components" [controller]: "/docs/agent/ -> /docs/agent//flow/concepts/component_controller" [controller]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/component_controller" -[type]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/types_and_values" -[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/types_and_values" +[type]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/types_and_values" +[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/types_and_values" {{% /docs/reference %}} \ No newline at end of file diff --git a/docs/sources/flow/config-language/expressions/_index.md b/docs/sources/flow/concepts/config-language/expressions/_index.md similarity index 51% rename from docs/sources/flow/config-language/expressions/_index.md rename to docs/sources/flow/concepts/config-language/expressions/_index.md index 991e7c163a20..56dc4c1ee4a1 100644 --- a/docs/sources/flow/config-language/expressions/_index.md +++ b/docs/sources/flow/concepts/config-language/expressions/_index.md @@ -1,11 +1,17 @@ --- aliases: -- ../configuration-language/expressions/ +- ../configuration-language/expressions/ # /docs/agent/latest/flow/concepts/configuration-language/expressions/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/expressions/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/expressions/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/expressions/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/ +# Previous page aliases for backwards compatibility: +- ../../configuration-language/expressions/ # /docs/agent/latest/flow/configuration-language/expressions/ - /docs/grafana-cloud/agent/flow/config-language/expressions/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/expressions/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/expressions/ - /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/expressions/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/expressions/ description: Learn about expressions title: Expressions weight: 400 @@ -23,10 +29,10 @@ All component arguments have an underlying [type][]. River checks the expression type before assigning the result to an attribute. {{% docs/reference %}} -[refer to values]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/referencing_exports" -[refer to values]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/referencing_exports" -[call functions]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/function_calls" -[call functions]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/function_calls" -[type]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/types_and_values" -[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/types_and_values" +[refer to values]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/referencing_exports" +[refer to values]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/referencing_exports" +[call functions]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/function_calls" +[call functions]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/function_calls" +[type]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/types_and_values" +[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/types_and_values" {{% /docs/reference %}} diff --git a/docs/sources/flow/config-language/expressions/function_calls.md b/docs/sources/flow/concepts/config-language/expressions/function_calls.md similarity index 63% rename from docs/sources/flow/config-language/expressions/function_calls.md rename to docs/sources/flow/concepts/config-language/expressions/function_calls.md index 2b773138cf71..b9598fea91a1 100644 --- a/docs/sources/flow/config-language/expressions/function_calls.md +++ b/docs/sources/flow/concepts/config-language/expressions/function_calls.md @@ -1,11 +1,17 @@ --- aliases: -- ../../configuration-language/expressions/function-calls/ +- ../../configuration-language/expressions/function-calls/ # /docs/agent/latest/flow/concepts/configuration-language/expressions/function-calls/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/expressions/function_calls/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/expressions/function_calls/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/expressions/function_calls/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/function_calls/ +# Previous page aliases for backwards compatibility: +- ../../../configuration-language/expressions/function-calls/ # /docs/agent/latest/flow/configuration-language/expressions/function-calls/ - /docs/grafana-cloud/agent/flow/config-language/expressions/function_calls/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/expressions/function_calls/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/expressions/function_calls/ - /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/function_calls/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/expressions/function_calls/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/expressions/function_calls/ description: Learn about function calls title: Function calls weight: 400 diff --git a/docs/sources/flow/config-language/expressions/operators.md b/docs/sources/flow/concepts/config-language/expressions/operators.md similarity index 84% rename from docs/sources/flow/config-language/expressions/operators.md rename to docs/sources/flow/concepts/config-language/expressions/operators.md index 309afb78ddc5..19bb003f74f3 100644 --- a/docs/sources/flow/config-language/expressions/operators.md +++ b/docs/sources/flow/concepts/config-language/expressions/operators.md @@ -1,11 +1,17 @@ --- aliases: -- ../../configuration-language/expressions/operators/ +- ../../configuration-language/expressions/operators/ # /docs/agent/latest/flow/concepts/configuration-language/expressions/operators/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/expressions/operators/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/expressions/operators/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/expressions/operators/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/operators/ +# Previous page aliases for backwards compatibility: +- ../../../configuration-language/expressions/operators/ # /docs/agent/latest/flow/configuration-language/expressions/operators/ - /docs/grafana-cloud/agent/flow/config-language/expressions/operators/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/expressions/operators/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/expressions/operators/ - /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/operators/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/expressions/operators/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/expressions/operators/ description: Learn about operators title: Operators weight: 300 diff --git a/docs/sources/flow/config-language/expressions/referencing_exports.md b/docs/sources/flow/concepts/config-language/expressions/referencing_exports.md similarity index 68% rename from docs/sources/flow/config-language/expressions/referencing_exports.md rename to docs/sources/flow/concepts/config-language/expressions/referencing_exports.md index 5923d6bd89c0..2cc7a8ca5b21 100644 --- a/docs/sources/flow/config-language/expressions/referencing_exports.md +++ b/docs/sources/flow/concepts/config-language/expressions/referencing_exports.md @@ -1,11 +1,17 @@ --- aliases: -- ../../configuration-language/expressions/referencing-exports/ +- ../../configuration-language/expressions/referencing-exports/ # /docs/agent/latest/flow/concepts/configuration-language/expressions/referencing-exports/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/expressions/referencing_exports/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/expressions/referencing_exports/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/expressions/referencing_exports/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/referencing_exports/ +# Previous page aliases for backwards compatibility: +- ../../../configuration-language/expressions/referencing-exports/ # /docs/agent/latest/flow/configuration-language/expressions/referencing-exports/ - /docs/grafana-cloud/agent/flow/config-language/expressions/referencing_exports/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/expressions/referencing_exports/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/expressions/referencing_exports/ - /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/referencing_exports/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/expressions/referencing_exports/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/expressions/referencing_exports/ description: Learn about referencing component exports title: Referencing component exports weight: 200 @@ -55,6 +61,6 @@ While you can only configure attributes using the basic River types, the exports of components can take on special internal River types, such as Secrets or Capsules, which expose different functionality. {{% docs/reference %}} -[type]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/types_and_values" -[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/types_and_values" +[type]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/types_and_values" +[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/types_and_values" {{% /docs/reference %}} \ No newline at end of file diff --git a/docs/sources/flow/config-language/expressions/types_and_values.md b/docs/sources/flow/concepts/config-language/expressions/types_and_values.md similarity index 90% rename from docs/sources/flow/config-language/expressions/types_and_values.md rename to docs/sources/flow/concepts/config-language/expressions/types_and_values.md index 9a641c34d286..1f27c0b5ecac 100644 --- a/docs/sources/flow/config-language/expressions/types_and_values.md +++ b/docs/sources/flow/concepts/config-language/expressions/types_and_values.md @@ -1,11 +1,17 @@ --- aliases: -- ../../configuration-language/expressions/types-and-values/ +- ../../configuration-language/expressions/types-and-values/ # /docs/agent/latest/flow/concepts/configuration-language/expressions/types-and-values/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/expressions/types_and_values/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/expressions/types_and_values/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/expressions/types_and_values/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/types_and_values/ +# Previous page aliases for backwards compatibility: +- ../../../configuration-language/expressions/types-and-values/ # /docs/agent/latest/flow/configuration-language/expressions/types-and-values/ - /docs/grafana-cloud/agent/flow/config-language/expressions/types_and_values/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/expressions/types_and_values/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/expressions/types_and_values/ - /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/types_and_values/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/expressions/types_and_values/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/expressions/types_and_values/ description: Learn about the River types and values title: Types and values weight: 100 @@ -161,7 +167,7 @@ If the key isn't a valid identifier, you must wrap it in double quotes like a st } ``` -{{% admonition type="Note" %}} +{{% admonition type="note" %}} Don't confuse objects with blocks. * An _object_ is a value assigned to an [Attribute][]. You **must** use commas between key-value pairs on separate lines. diff --git a/docs/sources/flow/config-language/files.md b/docs/sources/flow/concepts/config-language/files.md similarity index 53% rename from docs/sources/flow/config-language/files.md rename to docs/sources/flow/concepts/config-language/files.md index 2b5e12f7b6e1..bd5565635fe7 100644 --- a/docs/sources/flow/config-language/files.md +++ b/docs/sources/flow/concepts/config-language/files.md @@ -1,11 +1,17 @@ --- aliases: -- ../configuration-language/files/ +- ../configuration-language/files/ # /docs/agent/latest/flow/concepts/configuration-language/files/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/files/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/files/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/files/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/files/ +# Previous page aliases for backwards compatibility: +- ../../configuration-language/files/ # /docs/agent/latest/flow/configuration-language/files/ - /docs/grafana-cloud/agent/flow/config-language/files/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/files/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/files/ - /docs/grafana-cloud/send-data/agent/flow/config-language/files/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/files/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/files/ description: Learn about River files title: Files weight: 100 diff --git a/docs/sources/flow/config-language/syntax.md b/docs/sources/flow/concepts/config-language/syntax.md similarity index 81% rename from docs/sources/flow/config-language/syntax.md rename to docs/sources/flow/concepts/config-language/syntax.md index e085ca967007..6f55701dab67 100644 --- a/docs/sources/flow/config-language/syntax.md +++ b/docs/sources/flow/concepts/config-language/syntax.md @@ -1,11 +1,17 @@ --- aliases: -- ../configuration-language/syntax/ +- ../configuration-language/syntax/ # /docs/agent/latest/flow/concepts/configuration-language/syntax/ +- /docs/grafana-cloud/agent/flow/concepts/config-language/syntax/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/config-language/syntax/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/config-language/syntax/ +- /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/syntax/ +# Previous page aliases for backwards compatibility: +- ../../configuration-language/syntax/ # /docs/agent/latest/flow/configuration-language/syntax/ - /docs/grafana-cloud/agent/flow/config-language/syntax/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/syntax/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/syntax/ - /docs/grafana-cloud/send-data/agent/flow/config-language/syntax/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/syntax/ +canonical: https://grafana.com/docs/agent/latest/flow/concepts/config-language/syntax/ description: Learn about the River syntax title: Syntax weight: 200 @@ -112,8 +118,8 @@ River ignores other newlines and you can can enter as many newlines as you want. [identifier]: #identifiers {{% docs/reference %}} -[expression]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions" -[expression]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions" -[type]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/types_and_values" -[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/types_and_values" +[expression]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions" +[expression]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions" +[type]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/types_and_values" +[type]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/types_and_values" {{% /docs/reference %}} \ No newline at end of file diff --git a/docs/sources/flow/concepts/configuration_language.md b/docs/sources/flow/concepts/configuration_language.md deleted file mode 100644 index 69b1a7357e71..000000000000 --- a/docs/sources/flow/concepts/configuration_language.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -aliases: -- ../../concepts/configuration-language/ -- /docs/grafana-cloud/agent/flow/concepts/configuration_language/ -- /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/configuration_language/ -- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/configuration_language/ -- /docs/grafana-cloud/send-data/agent/flow/concepts/configuration_language/ -canonical: https://grafana.com/docs/agent/latest/flow/concepts/configuration_language/ -description: Learn about configuration language concepts -title: Configuration language concepts -weight: 400 ---- - -# Configuration language concepts - -The {{< param "PRODUCT_NAME" >}} _configuration language_, River, refers to the language used in configuration files that define and configure components to run. - -```river -prometheus.scrape "default" { - targets = [{ - "__address__" = "demo.robustperception.io:9090", - }] - forward_to = [prometheus.remote_write.default.receiver] -} - -prometheus.remote_write "default" { - endpoint { - url = "http://localhost:9009/api/prom/push" - } -} -``` - -River is designed with the following requirements in mind: - -* _Fast_: The configuration language must be fast so the component controller can quickly evaluate changes. -* _Simple_: The configuration language must be easy to read and write to minimize the learning curve. -* _Debuggable_: The configuration language must give detailed information when there's a mistake in the configuration file. - -## Attributes - -You use _Attributes_ to configure individual settings. -Attributes always take the form of `ATTRIBUTE_NAME = ATTRIBUTE_VALUE`. - -The following example shows how to set the `log_level` attribute to `"debug"`. - -```river -log_level = "debug" -``` - -## Expressions - -You use expressions to compute the value of an attribute. -The simplest expressions are constant values like `"debug"`, `32`, or `[1, 2, 3, 4]`. -River supports complex expressions, for example: - -* Referencing the exports of components: `local.file.password_file.content` -* Mathematical operations: `1 + 2`, `3 * 4`, `(5 * 6) + (7 + 8)` -* Equality checks: `local.file.file_a.content == local.file.file_b.content` -* Calling functions from River's standard library: `env("HOME")` retrieves the value of the `HOME` environment variable. - -You can use expressions for any attribute inside a component definition. - -### Referencing component exports - -The most common expression is to reference the exports of a component, for example, `local.file.password_file.content`. -You form a reference to a component's exports by merging the component's name (for example, `local.file`), -label (for example, `password_file`), and export name (for example, `content`), delimited by a period. - -## Blocks - -You use _Blocks_ to configure components and groups of attributes. -Each block can contain any number of attributes or nested blocks. - -```river -prometheus.remote_write "default" { - endpoint { - url = "http://localhost:9009/api/prom/push" - } -} -``` - -The preceding example has two blocks: - -* `prometheus.remote_write "default"`: A labeled block which instantiates a `prometheus.remote_write` component. - The label is the string `"default"`. -* `endpoint`: An unlabeled block inside the component that configures an endpoint to send metrics to. - This block sets the `url` attribute to specify the endpoint. - -## More information - -Refer to [Configuration language][config-docs] for more information about River. - -{{% docs/reference %}} -[config-docs]: "/docs/agent/ -> /docs/agent//flow/config-language" -[config-docs]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language" -{{% /docs/reference %}} diff --git a/docs/sources/flow/config-language/_index.md b/docs/sources/flow/config-language/_index.md deleted file mode 100644 index 2ed7afb8b284..000000000000 --- a/docs/sources/flow/config-language/_index.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -aliases: -- /docs/grafana-cloud/agent/flow/config-language/ -- /docs/grafana-cloud/monitor-infrastructure/agent/flow/config-language/ -- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/config-language/ -- /docs/grafana-cloud/send-data/agent/flow/config-language/ -- configuration-language/ -canonical: https://grafana.com/docs/agent/latest/flow/config-language/ -description: Learn about the configuration language -title: Configuration language -weight: 400 ---- - -# Configuration language - -{{< param "PRODUCT_NAME" >}} dynamically configures and connects components with a custom configuration language called River. - -River aims to reduce errors in configuration files by making configurations easier to read and write. -River configurations use blocks that can be easily copied and pasted from the documentation to help you get started as quickly as possible. - -A River configuration file tells {{< param "PRODUCT_NAME" >}} which components to launch and how to bind them together into a pipeline. - -The River syntax uses blocks, attributes, and expressions. - -```river -// Create a local.file component labeled my_file. -// This can be referenced by other components as local.file.my_file. -local.file "my_file" { - filename = "/tmp/my-file.txt" -} - -// Pattern for creating a labeled block, which the above block follows: -BLOCK_NAME "BLOCK_LABEL" { - // Block body - IDENTIFIER = EXPRESSION // Attribute -} - -// Pattern for creating an unlabeled block: -BLOCK_NAME { - // Block body - IDENTIFIER = EXPRESSION // Attribute -} -``` - -[River][RFC] is similar to HCL, the language Terraform and other Hashicorp projects use. -It's a distinct language with custom syntax and features, such as first-class functions. - -* Blocks are a group of related settings and usually represent creating a component. - Blocks have a name that consists of zero or more identifiers separated by `.`, an optional user label, and a body containing attributes and nested blocks. -* Attributes appear within blocks and assign a value to a name. -* Expressions represent a value, either literally or by referencing and combining other values. - You use expressions to compute a value for an attribute. - -River is declarative, so ordering components, blocks, and attributes within a block isn't significant. -The relationship between components determines the order of operations. - -## Tooling - -You can use one or all of the following tools to help you write configuration files in River. - -* Experimental editor support for - * [vim](https://github.com/rfratto/vim-river) - * [VSCode](https://github.com/rfratto/vscode-river) - * [river-mode](https://github.com/jdbaldry/river-mode) for Emacs -* Code formatting using the [`agent fmt` command][fmt] - -You can also start developing your own tooling using the {{< param "PRODUCT_ROOT_NAME" >}} repository as a go package or use the -[tree-sitter grammar][] with other programming languages. - -[RFC]: https://github.com/grafana/agent/blob/97a55d0d908b26dbb1126cc08b6dcc18f6e30087/docs/rfcs/0005-river.md -[vim]: https://github.com/rfratto/vim-river -[VSCode]: https://github.com/rfratto/vscode-river -[river-mode]: https://github.com/jdbaldry/river-mode -[tree-sitter grammar]: https://github.com/grafana/tree-sitter-river - -{{% docs/reference %}} -[fmt]: "/docs/agent/ -> /docs/agent//flow/reference/cli/fmt" -[fmt]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/cli/fmt" -{{% /docs/reference %}} \ No newline at end of file diff --git a/docs/sources/flow/getting-started/collect-prometheus-metrics.md b/docs/sources/flow/getting-started/collect-prometheus-metrics.md index cbd7eb271318..be6d2ce71e01 100644 --- a/docs/sources/flow/getting-started/collect-prometheus-metrics.md +++ b/docs/sources/flow/getting-started/collect-prometheus-metrics.md @@ -440,6 +440,6 @@ prometheus.remote_write "default" { [prometheus.scrape]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/components/prometheus.scrape.md" [Components]: "/docs/agent/ -> /docs/agent//flow/concepts/components.md" [Components]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/components.md" -[Objects]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/types_and_values.md#objects" -[Objects]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/types_and_values.md#objects" +[Objects]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/types_and_values.md#objects" +[Objects]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/types_and_values.md#objects" {{% /docs/reference %}} diff --git a/docs/sources/flow/getting-started/migrating-from-prometheus.md b/docs/sources/flow/getting-started/migrating-from-prometheus.md index a05f709d66f3..8d77d6914340 100644 --- a/docs/sources/flow/getting-started/migrating-from-prometheus.md +++ b/docs/sources/flow/getting-started/migrating-from-prometheus.md @@ -254,8 +254,8 @@ The following list is specific to the convert command and not {{< param "PRODUCT [Start]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/setup/start-agent.md" [DebuggingUI]: "/docs/agent/ -> /docs/agent//flow/monitoring/debugging.md" [DebuggingUI]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/monitoring/debugging.md" -[River]: "/docs/agent/ -> /docs/agent//flow/config-language/_index.md" -[River]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/_index.md" +[River]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/_index.md" +[River]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/_index.md" [UI]: "/docs/agent/ -> /docs/agent//flow/monitoring/debugging#grafana-agent-flow-ui" [UI]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/monitoring/debugging#grafana-agent-flow-ui" {{% /docs/reference %}} diff --git a/docs/sources/flow/getting-started/migrating-from-promtail.md b/docs/sources/flow/getting-started/migrating-from-promtail.md index a82b27666128..4799e0e20b5f 100644 --- a/docs/sources/flow/getting-started/migrating-from-promtail.md +++ b/docs/sources/flow/getting-started/migrating-from-promtail.md @@ -237,8 +237,8 @@ The following list is specific to the convert command and not {{< param "PRODUCT [Start]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/setup/start-agent.md" [DebuggingUI]: "/docs/agent/ -> /docs/agent//flow/monitoring/debugging.md" [DebuggingUI]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/monitoring/debugging.md" -[River]: "/docs/agent/ -> /docs/agent//flow/config-language/_index.md" -[River]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/_index.md" +[River]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/_index.md" +[River]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/_index.md" [UI]: "/docs/agent/ -> /docs/agent//flow/monitoring/debugging#grafana-agent-flow-ui" [UI]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/monitoring/debugging#grafana-agent-flow-ui" {{% /docs/reference %}} diff --git a/docs/sources/flow/getting-started/migrating-from-static.md b/docs/sources/flow/getting-started/migrating-from-static.md index 8c2a3ff88b22..8b7b1f98721e 100644 --- a/docs/sources/flow/getting-started/migrating-from-static.md +++ b/docs/sources/flow/getting-started/migrating-from-static.md @@ -372,8 +372,8 @@ The following list is specific to the convert command and not {{< param "PRODUCT [Start]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/setup/start-agent.md" [DebuggingUI]: "/docs/agent/ -> /docs/agent//flow/monitoring/debugging.md" [DebuggingUI]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/monitoring/debugging.md" -[River]: "/docs/agent/ -> /docs/agent//flow/config-language/" -[River]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/" +[River]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/" +[River]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/" [Integrations next]: "/docs/agent/ -> /docs/agent//static/configuration/integrations/integrations-next/_index.md" [Integrations next]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/static/configuration/traces-config.md [Traces]: "/docs/agent/ -> /docs/agent//static/configuration/traces-config.md" diff --git a/docs/sources/flow/monitoring/debugging.md b/docs/sources/flow/monitoring/debugging.md index 98bbda9cee7e..a3d148e52487 100644 --- a/docs/sources/flow/monitoring/debugging.md +++ b/docs/sources/flow/monitoring/debugging.md @@ -113,8 +113,8 @@ To debug issues when using [clustering][], check for the following symptoms. [clustering]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/clustering.md" [install]: "/docs/agent/ -> /docs/agent//flow/setup/install" [install]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/setup/install" -[secret]: "/docs/agent/ -> /docs/agent//flow/config-language/expressions/types_and_values.md#secrets.md" -[secret]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/config-language/expressions/types_and_values.md#secrets.md" +[secret]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/expressions/types_and_values.md#secrets.md" +[secret]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/expressions/types_and_values.md#secrets.md" [grafana-agent run]: "/docs/agent/ -> /docs/agent//flow/reference/cli/run.md" [grafana-agent run]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/cli/run.md" {{% /docs/reference %}} diff --git a/docs/sources/flow/reference/compatibility/_index.md b/docs/sources/flow/reference/compatibility/_index.md index c619c974a4c3..9e225aa74b71 100644 --- a/docs/sources/flow/reference/compatibility/_index.md +++ b/docs/sources/flow/reference/compatibility/_index.md @@ -32,7 +32,7 @@ that can export or consume it. ## Targets -Targets are a `list(map(string))` - a [list]({{< relref "../../config-language/expressions/types_and_values/#naming-convention" >}}) of [maps]({{< relref "../../config-language/expressions/types_and_values/#naming-convention" >}}) with [string]({{< relref "../../config-language/expressions/types_and_values/#strings" >}}) values. +Targets are a `list(map(string))` - a [list]({{< relref "../../concepts/config-language/expressions/types_and_values/#naming-convention" >}}) of [maps]({{< relref "../../concepts/config-language/expressions/types_and_values/#naming-convention" >}}) with [string]({{< relref "../../concepts/config-language/expressions/types_and_values/#strings" >}}) values. They can contain different key-value pairs, and you can use them with a wide range of components. Some components require Targets to contain specific key-value pairs to work correctly. It is recommended to always check component references for @@ -152,7 +152,7 @@ The following components, grouped by namespace, _consume_ Targets. ## Prometheus `MetricsReceiver` The Prometheus metrics are sent between components using `MetricsReceiver`s. -`MetricsReceiver`s are [capsules]({{< relref "../../config-language/expressions/types_and_values/#capsules" >}}) +`MetricsReceiver`s are [capsules]({{< relref "../../concepts/config-language/expressions/types_and_values/#capsules" >}}) that are exported by components that can receive Prometheus metrics. Components that can consume Prometheus metrics can be passed the `MetricsReceiver` as an argument. Use the following components to build your Prometheus metrics pipeline: @@ -200,7 +200,7 @@ The following components, grouped by namespace, _consume_ Prometheus `MetricsRec ## Loki `LogsReceiver` -`LogsReceiver` is a [capsule]({{< relref "../../config-language/expressions/types_and_values/#capsules" >}}) +`LogsReceiver` is a [capsule]({{< relref "../../concepts/config-language/expressions/types_and_values/#capsules" >}}) that is exported by components that can receive Loki logs. Components that consume `LogsReceiver` as an argument typically send logs to it. Use the following components to build your Loki logs pipeline: @@ -265,7 +265,7 @@ The following components, grouped by namespace, _consume_ Loki `LogsReceiver`. ## OpenTelemetry `otelcol.Consumer` The OpenTelemetry data is sent between components using `otelcol.Consumer`s. -`otelcol.Consumer`s are [capsules]({{< relref "../../config-language/expressions/types_and_values/#capsules" >}}) +`otelcol.Consumer`s are [capsules]({{< relref "../../concepts/config-language/expressions/types_and_values/#capsules" >}}) that are exported by components that can receive OpenTelemetry data. Components that can consume OpenTelemetry data can be passed the `otelcol.Consumer` as an argument. Note that some components that use `otelcol.Consumer` only support a subset of telemetry signals, for example, only traces. Check the component @@ -342,7 +342,7 @@ The following components, grouped by namespace, _consume_ OpenTelemetry `otelcol ## Pyroscope `ProfilesReceiver` The Pyroscope profiles are sent between components using `ProfilesReceiver`s. -`ProfilesReceiver`s are [capsules]({{< relref "../../config-language/expressions/types_and_values/#capsules" >}}) +`ProfilesReceiver`s are [capsules]({{< relref "../../concepts/config-language/expressions/types_and_values/#capsules" >}}) that are exported by components that can receive Pyroscope profiles. Components that can consume Pyroscope profiles can be passed the `ProfilesReceiver` as an argument. Use the following components to build your Pyroscope profiles pipeline: diff --git a/docs/sources/flow/reference/components/local.file.md b/docs/sources/flow/reference/components/local.file.md index 63c44912686b..5e935a0bbbf5 100644 --- a/docs/sources/flow/reference/components/local.file.md +++ b/docs/sources/flow/reference/components/local.file.md @@ -39,7 +39,7 @@ Name | Type | Description | Default | Required `poll_frequency` | `duration` | How often to poll for file changes | `"1m"` | no `is_secret` | `bool` | Marks the file as containing a [secret][] | `false` | no -[secret]: {{< relref "../../config-language/expressions/types_and_values.md#secrets" >}} +[secret]: {{< relref "../../concepts/config-language/expressions/types_and_values.md#secrets" >}} {{< docs/shared lookup="flow/reference/components/local-file-arguments-text.md" source="agent" version="" >}} diff --git a/docs/sources/flow/reference/components/module.file.md b/docs/sources/flow/reference/components/module.file.md index 803883a9119c..0e4b8b19d249 100644 --- a/docs/sources/flow/reference/components/module.file.md +++ b/docs/sources/flow/reference/components/module.file.md @@ -51,7 +51,7 @@ Name | Type | Description | Default | Required `poll_frequency` | `duration` | How often to poll for file changes | `"1m"` | no `is_secret` | `bool` | Marks the file as containing a [secret][] | `false` | no -[secret]: {{< relref "../../config-language/expressions/types_and_values.md#secrets" >}} +[secret]: {{< relref "../../concepts/config-language/expressions/types_and_values.md#secrets" >}} {{< docs/shared lookup="flow/reference/components/local-file-arguments-text.md" source="agent" version="" >}} diff --git a/docs/sources/flow/reference/components/module.http.md b/docs/sources/flow/reference/components/module.http.md index e4e61e7b53fd..24e140f79430 100644 --- a/docs/sources/flow/reference/components/module.http.md +++ b/docs/sources/flow/reference/components/module.http.md @@ -52,7 +52,7 @@ Name | Type | Description | Default | Required `poll_timeout` | `duration` | Timeout when polling the URL. | `"10s"` | no `is_secret` | `bool` | Whether the response body should be treated as a secret. | false | no -[secret]: {{< relref "../../config-language/expressions/types_and_values.md#secrets" >}} +[secret]: {{< relref "../../concepts/config-language/expressions/types_and_values.md#secrets" >}} ## Blocks diff --git a/docs/sources/flow/reference/components/otelcol.processor.filter.md b/docs/sources/flow/reference/components/otelcol.processor.filter.md index 1912ad4ab1a1..49a11028a80c 100644 --- a/docs/sources/flow/reference/components/otelcol.processor.filter.md +++ b/docs/sources/flow/reference/components/otelcol.processor.filter.md @@ -290,7 +290,7 @@ Some values in the River strings are [escaped][river-strings]: * `\` is escaped with `\\` * `"` is escaped with `\"` -[river-strings]: {{< relref "../../config-language/expressions/types_and_values.md/#strings" >}} +[river-strings]: {{< relref "../../concepts/config-language/expressions/types_and_values.md/#strings" >}} [OTTL]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.85.0/pkg/ottl/README.md diff --git a/docs/sources/flow/reference/components/otelcol.processor.transform.md b/docs/sources/flow/reference/components/otelcol.processor.transform.md index cc214d8a5551..81967bb11c24 100644 --- a/docs/sources/flow/reference/components/otelcol.processor.transform.md +++ b/docs/sources/flow/reference/components/otelcol.processor.transform.md @@ -55,8 +55,8 @@ For example, the OTTL statement `set(description, "Sum") where type == "Sum"` ca Raw strings are generally more convenient for writing OTTL statements. -[river-strings]: {{< relref "../../config-language/expressions/types_and_values.md/#strings" >}} -[river-raw-strings]: {{< relref "../../config-language/expressions/types_and_values.md/#raw-strings" >}} +[river-strings]: {{< relref "../../concepts/config-language/expressions/types_and_values.md/#strings" >}} +[river-raw-strings]: {{< relref "../../concepts/config-language/expressions/types_and_values.md/#raw-strings" >}} {{% /admonition %}} {{% admonition type="note" %}} @@ -566,8 +566,8 @@ Each statement is enclosed in backticks instead of quotation marks. This constitutes a [raw string][river-raw-strings], and lets us avoid the need to escape each `"` with a `\"`, and each `\` with a `\\` inside a [normal][river-strings] River string. -[river-strings]: {{< relref "../../config-language/expressions/types_and_values.md/#strings" >}} -[river-raw-strings]: {{< relref "../../config-language/expressions/types_and_values.md/#raw-strings" >}} +[river-strings]: {{< relref "../../concepts/config-language/expressions/types_and_values.md/#strings" >}} +[river-raw-strings]: {{< relref "../../concepts/config-language/expressions/types_and_values.md/#raw-strings" >}} [traces protobuf]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.0.0/opentelemetry/proto/trace/v1/trace.proto [metrics protobuf]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.0.0/opentelemetry/proto/metrics/v1/metrics.proto diff --git a/docs/sources/flow/reference/components/remote.http.md b/docs/sources/flow/reference/components/remote.http.md index 7428cb62d18d..e91fc6c409a0 100644 --- a/docs/sources/flow/reference/components/remote.http.md +++ b/docs/sources/flow/reference/components/remote.http.md @@ -54,7 +54,7 @@ The poll is successful if the URL returns a `200 OK` response code. All other response codes are treated as errors and mark the component as unhealthy. After a successful poll, the response body from the URL is exported. -[secret]: {{< relref "../../config-language/expressions/types_and_values.md#secrets" >}} +[secret]: {{< relref "../../concepts/config-language/expressions/types_and_values.md#secrets" >}} ## Blocks diff --git a/docs/sources/flow/reference/components/remote.s3.md b/docs/sources/flow/reference/components/remote.s3.md index 7e927e11b51f..c4ec8e195e86 100644 --- a/docs/sources/flow/reference/components/remote.s3.md +++ b/docs/sources/flow/reference/components/remote.s3.md @@ -44,7 +44,7 @@ Name | Type | Description | Default | Required > **NOTE**: `path` must include a full path to a file. This does not support reading of directories. -[secret]: {{< relref "../../config-language/expressions/types_and_values.md#secrets" >}} +[secret]: {{< relref "../../concepts/config-language/expressions/types_and_values.md#secrets" >}} ## Blocks diff --git a/docs/sources/flow/reference/stdlib/nonsensitive.md b/docs/sources/flow/reference/stdlib/nonsensitive.md index 2763ac952ace..a2bb0bd31d49 100644 --- a/docs/sources/flow/reference/stdlib/nonsensitive.md +++ b/docs/sources/flow/reference/stdlib/nonsensitive.md @@ -20,7 +20,7 @@ title: nonsensitive > Strings resulting from calls to `nonsensitive` will be displayed in plaintext > in the UI and internal API calls. -[secret]: {{< relref "../../config-language/expressions/types_and_values.md#secrets" >}} +[secret]: {{< relref "../../concepts/config-language/expressions/types_and_values.md#secrets" >}} ## Examples diff --git a/docs/sources/flow/tutorials/collecting-prometheus-metrics.md b/docs/sources/flow/tutorials/collecting-prometheus-metrics.md index ecaf186e4a3d..a66547419064 100644 --- a/docs/sources/flow/tutorials/collecting-prometheus-metrics.md +++ b/docs/sources/flow/tutorials/collecting-prometheus-metrics.md @@ -99,8 +99,8 @@ To try out {{< param "PRODUCT_ROOT_NAME" >}} without using Docker: {{% docs/reference %}} [prometheus.scrape]: "/docs/agent/ -> /docs/agent//flow/reference/components/prometheus.scrape.md" [prometheus.scrape]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/components/prometheus.scrape.md" -[attribute]: "/docs/agent/ -> /docs/agent//flow/concepts/configuration_language.md#attributes" -[attribute]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/configuration_language.md#attributes" +[attribute]: "/docs/agent/ -> /docs/agent//flow/concepts/config-language/#attributes" +[attribute]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/config-language/#attributes" [argument]: "/docs/agent/ -> /docs/agent//flow/concepts/components" [argument]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/components" [export]: "/docs/agent/ -> /docs/agent//flow/concepts/components" From 1890a93848fa10ca1bce2ad26e622c824c158d4f Mon Sep 17 00:00:00 2001 From: Piotr <17101802+thampiotr@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:55:23 +0100 Subject: [PATCH 08/19] Add resource usage guidelines docs (#6028) * wip docs * wip * editing * update with experimental results of 1m scrape interval * feedback * fix-formatting --- .../flow/monitoring/agent-resource-usage.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docs/sources/flow/monitoring/agent-resource-usage.md diff --git a/docs/sources/flow/monitoring/agent-resource-usage.md b/docs/sources/flow/monitoring/agent-resource-usage.md new file mode 100644 index 000000000000..f7a44c638555 --- /dev/null +++ b/docs/sources/flow/monitoring/agent-resource-usage.md @@ -0,0 +1,77 @@ +--- +aliases: + - /docs/agent/flow/monitoring/resource-usage/ + - /docs/grafana-cloud/agent/flow/monitoring/resource-usage/ + - /docs/grafana-cloud/monitor-infrastructure/agent/flow/monitoring/resource-usage/ + - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/monitoring/resource-usage/ + - /docs/grafana-cloud/send-data/agent/flow/monitoring/resource-usage/ +canonical: https://grafana.com/docs/agent/latest/flow/monitoring/resource-usage/ +description: Guidance for expected Agent resource usage +headless: true +title: Resource usage +--- + +# {{% param "PRODUCT_NAME" %}} resource usage + +This page provides guidance for expected resource usage of +{{% param "PRODUCT_NAME" %}} for each telemetry type, based on operational +experience of some of the {{% param "PRODUCT_NAME" %}} maintainers. + +{{% admonition type="note" %}} + +The resource usage depends on the workload, hardware and the configuration used. +The information on this page is a good starting point for most users, but your +actual usage may be different. + +{{% /admonition %}} + +## Prometheus metrics + +The Prometheus metrics resource usage depends mainly on the number of active +series that need to be scraped and the scrape interval. + +As a rule of thumb, **per each 1 million active series** and with the default +scrape interval, you can expect to use approximately: + +* 1.5 CPU cores +* 11 GiB of memory +* 1.5 MiB/s of total network bandwidth, send and receive + +These recommendations are based on deployments that use [clustering][], but they +will broadly apply to other deployment modes. For more information on how to +deploy {{% param "PRODUCT_NAME" %}}, see +[deploying grafana agent][]. + +[deploying grafana agent]: {{< relref "../setup/deploy-agent.md" >}} +[clustering]: {{< relref "../concepts/clustering.md" >}} + +## Loki logs + +Loki logs resource usage depends mainly on the volume of logs ingested. + +As a rule of thumb, **per each 1 MiB/second of logs ingested**, you can expect +to use approximately: + +* 1 CPU core +* 120 MiB of memory + +These recommendations are based on Kubernetes DaemonSet deployments on clusters +with relatively small number of nodes and high logs volume on each. The resource +usage can be higher per each 1 MiB/second of logs if you have a large number of +small nodes due to the constant overhead of running the {{% param "PRODUCT_NAME" %}} on each node. + +Additionally, factors such as number of labels, number of files and average log +line length may all play a role in the resource usage. + +## Pyroscope profiles + +Pyroscope profiles resource usage depends mainly on the volume of profiles. + +As a rule of thumb, **per each 100 profiles/second**, you can expect to use +approximately: + +* 1 CPU core +* 10 GiB of memory + +Factors such as size of each profile and frequency of fetching them also play a +role in the overall resource usage. From 6e4a9b999ba40e77bbd449bb5feaf6332335b6bb Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Thu, 4 Jan 2024 08:45:07 -0500 Subject: [PATCH 09/19] prometheus.exporter.kafka: use correct secret type (#6046) Use rivertypes.Secret for sensitive fields instead of Prometheus' secret type. Fixes #6044. --- CHANGELOG.md | 16 +++--- component/prometheus/exporter/kafka/kafka.go | 49 ++++++++++--------- .../prometheus/exporter/kafka/kafka_test.go | 12 +++++ .../internal/build/kafka_exporter.go | 3 +- 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b83ee4d268c..a86d9b1960f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,8 @@ Main (unreleased) - `otelcol.receiver.prometheus` will drop all `otel_scope_info` metrics when converting them to OTLP. (@wildum) - If the `otel_scope_info` metric has labels `otel_scope_name` and `otel_scope_version`, - their values will be used to set OTLP Instrumentation Scope name and version respectively. - - Labels of `otel_scope_info` metrics other than `otel_scope_name` and `otel_scope_version` + their values will be used to set OTLP Instrumentation Scope name and version respectively. + - Labels of `otel_scope_info` metrics other than `otel_scope_name` and `otel_scope_version` are added as scope attributes with the matching name and version. - The `target` block in `prometheus.exporter.blackbox` requires a mandatory `name` @@ -57,7 +57,7 @@ Main (unreleased) - Added links between compatible components in the documentation to make it easier to discover them. (@thampiotr) - + - Allow defining `HTTPClientConfig` for `discovery.ec2`. (@cmbrad) - The `remote.http` component can optionally define a request body. (@tpaschalis) @@ -71,8 +71,8 @@ Main (unreleased) - Added 'country' mmdb-type to log pipeline-stage geoip. (@superstes) - Azure exporter enhancements for flow and static mode, (@kgeckhart) - - Allows for pulling metrics at the Azure subscription level instead of resource by resource - - Disable dimension validation by default to reduce the number of exporter instances needed for full dimension coverage + - Allows for pulling metrics at the Azure subscription level instead of resource by resource + - Disable dimension validation by default to reduce the number of exporter instances needed for full dimension coverage - Add `max_cache_size` to `prometheus.relabel` to allow configurability instead of hard coded 100,000. (@mattdurham) @@ -81,11 +81,11 @@ Main (unreleased) ### Bugfixes - Update `pyroscope.ebpf` to fix a logical bug causing to profile to many kthreads instead of regular processes https://github.com/grafana/pyroscope/pull/2778 (@korniltsev) - + - Update `pyroscope.ebpf` to produce more optimal pprof profiles for python processes https://github.com/grafana/pyroscope/pull/2788 (@korniltsev) - In Static mode's `traces` subsystem, `spanmetrics` used to be generated prior to load balancing. - This could lead to inaccurate metrics. This issue only affects Agents using both `spanmetrics` and + This could lead to inaccurate metrics. This issue only affects Agents using both `spanmetrics` and `load_balancing`, when running in a load balanced cluster with more than one Agent instance. (@ptodev) - Fixes `loki.source.docker` a behavior that synced an incomplete list of targets to the tailer manager. (@FerdinandvHagen) @@ -94,6 +94,8 @@ Main (unreleased) - Add staleness tracking to labelstore to reduce memory usage. (@mattdurham) +- Fix issue where `prometheus.exporter.kafka` would crash when configuring `sasl_password`. (@rfratto) + ### Other changes - Bump github.com/IBM/sarama from v1.41.2 to v1.42.1 diff --git a/component/prometheus/exporter/kafka/kafka.go b/component/prometheus/exporter/kafka/kafka.go index f146c40bae3c..f68985b50d2c 100644 --- a/component/prometheus/exporter/kafka/kafka.go +++ b/component/prometheus/exporter/kafka/kafka.go @@ -9,7 +9,8 @@ import ( "github.com/grafana/agent/component/prometheus/exporter" "github.com/grafana/agent/pkg/integrations" "github.com/grafana/agent/pkg/integrations/kafka_exporter" - config_util "github.com/prometheus/common/config" + "github.com/grafana/river/rivertypes" + "github.com/prometheus/common/config" ) var DefaultArguments = Arguments{ @@ -24,28 +25,28 @@ var DefaultArguments = Arguments{ } type Arguments struct { - Instance string `river:"instance,attr,optional"` - KafkaURIs []string `river:"kafka_uris,attr,optional"` - UseSASL bool `river:"use_sasl,attr,optional"` - UseSASLHandshake bool `river:"use_sasl_handshake,attr,optional"` - SASLUsername string `river:"sasl_username,attr,optional"` - SASLPassword config_util.Secret `river:"sasl_password,attr,optional"` - SASLMechanism string `river:"sasl_mechanism,attr,optional"` - UseTLS bool `river:"use_tls,attr,optional"` - CAFile string `river:"ca_file,attr,optional"` - CertFile string `river:"cert_file,attr,optional"` - KeyFile string `river:"key_file,attr,optional"` - InsecureSkipVerify bool `river:"insecure_skip_verify,attr,optional"` - KafkaVersion string `river:"kafka_version,attr,optional"` - UseZooKeeperLag bool `river:"use_zookeeper_lag,attr,optional"` - ZookeeperURIs []string `river:"zookeeper_uris,attr,optional"` - ClusterName string `river:"kafka_cluster_name,attr,optional"` - MetadataRefreshInterval string `river:"metadata_refresh_interval,attr,optional"` - AllowConcurrent bool `river:"allow_concurrency,attr,optional"` - MaxOffsets int `river:"max_offsets,attr,optional"` - PruneIntervalSeconds int `river:"prune_interval_seconds,attr,optional"` - TopicsFilter string `river:"topics_filter_regex,attr,optional"` - GroupFilter string `river:"groups_filter_regex,attr,optional"` + Instance string `river:"instance,attr,optional"` + KafkaURIs []string `river:"kafka_uris,attr,optional"` + UseSASL bool `river:"use_sasl,attr,optional"` + UseSASLHandshake bool `river:"use_sasl_handshake,attr,optional"` + SASLUsername string `river:"sasl_username,attr,optional"` + SASLPassword rivertypes.Secret `river:"sasl_password,attr,optional"` + SASLMechanism string `river:"sasl_mechanism,attr,optional"` + UseTLS bool `river:"use_tls,attr,optional"` + CAFile string `river:"ca_file,attr,optional"` + CertFile string `river:"cert_file,attr,optional"` + KeyFile string `river:"key_file,attr,optional"` + InsecureSkipVerify bool `river:"insecure_skip_verify,attr,optional"` + KafkaVersion string `river:"kafka_version,attr,optional"` + UseZooKeeperLag bool `river:"use_zookeeper_lag,attr,optional"` + ZookeeperURIs []string `river:"zookeeper_uris,attr,optional"` + ClusterName string `river:"kafka_cluster_name,attr,optional"` + MetadataRefreshInterval string `river:"metadata_refresh_interval,attr,optional"` + AllowConcurrent bool `river:"allow_concurrency,attr,optional"` + MaxOffsets int `river:"max_offsets,attr,optional"` + PruneIntervalSeconds int `river:"prune_interval_seconds,attr,optional"` + TopicsFilter string `river:"topics_filter_regex,attr,optional"` + GroupFilter string `river:"groups_filter_regex,attr,optional"` } func init() { @@ -93,7 +94,7 @@ func (a *Arguments) Convert() *kafka_exporter.Config { UseSASL: a.UseSASL, UseSASLHandshake: a.UseSASLHandshake, SASLUsername: a.SASLUsername, - SASLPassword: a.SASLPassword, + SASLPassword: config.Secret(a.SASLPassword), SASLMechanism: a.SASLMechanism, UseTLS: a.UseTLS, CAFile: a.CAFile, diff --git a/component/prometheus/exporter/kafka/kafka_test.go b/component/prometheus/exporter/kafka/kafka_test.go index 26f321dc39fa..4209da21cb7d 100644 --- a/component/prometheus/exporter/kafka/kafka_test.go +++ b/component/prometheus/exporter/kafka/kafka_test.go @@ -107,3 +107,15 @@ func TestCustomizeTarget(t *testing.T) { require.Equal(t, 1, len(newTargets)) require.Equal(t, "example", newTargets[0]["instance"]) } + +func TestSASLPassword(t *testing.T) { // #6044 + var exampleRiverConfig = ` + kafka_uris = ["broker1"] + use_sasl = true + sasl_password = "foobar" + ` + + var args Arguments + err := river.Unmarshal([]byte(exampleRiverConfig), &args) + require.NoError(t, err) +} diff --git a/converter/internal/staticconvert/internal/build/kafka_exporter.go b/converter/internal/staticconvert/internal/build/kafka_exporter.go index 25310e35a5f4..16be4275ddce 100644 --- a/converter/internal/staticconvert/internal/build/kafka_exporter.go +++ b/converter/internal/staticconvert/internal/build/kafka_exporter.go @@ -4,6 +4,7 @@ import ( "github.com/grafana/agent/component/discovery" "github.com/grafana/agent/component/prometheus/exporter/kafka" "github.com/grafana/agent/pkg/integrations/kafka_exporter" + "github.com/grafana/river/rivertypes" ) func (b *IntegrationsConfigBuilder) appendKafkaExporter(config *kafka_exporter.Config, instanceKey *string) discovery.Exports { @@ -17,7 +18,7 @@ func toKafkaExporter(config *kafka_exporter.Config) *kafka.Arguments { UseSASL: config.UseSASL, UseSASLHandshake: config.UseSASLHandshake, SASLUsername: config.SASLUsername, - SASLPassword: config.SASLPassword, + SASLPassword: rivertypes.Secret(config.SASLPassword), SASLMechanism: config.SASLMechanism, UseTLS: config.UseTLS, CAFile: config.CAFile, From 900a0352d86d5f5e6890041516a2f2f9e20e89c0 Mon Sep 17 00:00:00 2001 From: Piotr <17101802+thampiotr@users.noreply.github.com> Date: Thu, 4 Jan 2024 14:59:45 +0100 Subject: [PATCH 10/19] Fix incorrect CPU calculation (#6047) --- docs/sources/flow/monitoring/agent-resource-usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/flow/monitoring/agent-resource-usage.md b/docs/sources/flow/monitoring/agent-resource-usage.md index f7a44c638555..21b16106d5a3 100644 --- a/docs/sources/flow/monitoring/agent-resource-usage.md +++ b/docs/sources/flow/monitoring/agent-resource-usage.md @@ -33,7 +33,7 @@ series that need to be scraped and the scrape interval. As a rule of thumb, **per each 1 million active series** and with the default scrape interval, you can expect to use approximately: -* 1.5 CPU cores +* 0.4 CPU cores * 11 GiB of memory * 1.5 MiB/s of total network bandwidth, send and receive From cce5b03b141d8bf43ca4ab473c8f07d6d9136b3d Mon Sep 17 00:00:00 2001 From: Erik Baranowski <39704712+erikbaranowski@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:20:44 -0500 Subject: [PATCH 11/19] Wire up for eventhandler integration in the static to flow converter (#6039) --- .../staticconvert/internal/build/builder.go | 7 +- .../internal/build/eventhandler.go | 98 +++++++++++++++++++ .../testdata-v2/integrations_v2.river | 20 ++++ .../testdata-v2/integrations_v2.yaml | 6 ++ .../testdata-v2/unsupported.diags | 5 +- .../testdata-v2/unsupported.river | 11 +++ .../testdata-v2/unsupported.yaml | 13 ++- converter/internal/staticconvert/validate.go | 6 +- 8 files changed, 160 insertions(+), 6 deletions(-) create mode 100644 converter/internal/staticconvert/internal/build/eventhandler.go diff --git a/converter/internal/staticconvert/internal/build/builder.go b/converter/internal/staticconvert/internal/build/builder.go index 0f92fa327363..58fedf6225c2 100644 --- a/converter/internal/staticconvert/internal/build/builder.go +++ b/converter/internal/staticconvert/internal/build/builder.go @@ -42,7 +42,8 @@ import ( app_agent_receiver_v2 "github.com/grafana/agent/pkg/integrations/v2/app_agent_receiver" blackbox_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/blackbox_exporter" common_v2 "github.com/grafana/agent/pkg/integrations/v2/common" - "github.com/grafana/agent/pkg/integrations/v2/metricsutils" + eventhandler_v2 "github.com/grafana/agent/pkg/integrations/v2/eventhandler" + metricsutils_v2 "github.com/grafana/agent/pkg/integrations/v2/metricsutils" snmp_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/snmp_exporter" vmware_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/vmware_exporter" "github.com/grafana/agent/pkg/integrations/windows_exporter" @@ -229,13 +230,15 @@ func (b *IntegrationsConfigBuilder) appendV2Integrations() { case *blackbox_exporter_v2.Config: exports = b.appendBlackboxExporterV2(itg) commonConfig = itg.Common + case *eventhandler_v2.Config: + b.appendEventHandlerV2(itg) case *snmp_exporter_v2.Config: exports = b.appendSnmpExporterV2(itg) commonConfig = itg.Common case *vmware_exporter_v2.Config: exports = b.appendVmwareExporterV2(itg) commonConfig = itg.Common - case *metricsutils.ConfigShim: + case *metricsutils_v2.ConfigShim: commonConfig = itg.Common switch v1_itg := itg.Orig.(type) { case *azure_exporter.Config: diff --git a/converter/internal/staticconvert/internal/build/eventhandler.go b/converter/internal/staticconvert/internal/build/eventhandler.go new file mode 100644 index 000000000000..bf816d6d451a --- /dev/null +++ b/converter/internal/staticconvert/internal/build/eventhandler.go @@ -0,0 +1,98 @@ +package build + +import ( + "fmt" + + "github.com/grafana/agent/component/common/loki" + flow_relabel "github.com/grafana/agent/component/common/relabel" + "github.com/grafana/agent/component/loki/relabel" + "github.com/grafana/agent/component/loki/source/kubernetes_events" + "github.com/grafana/agent/converter/diag" + "github.com/grafana/agent/converter/internal/common" + eventhandler_v2 "github.com/grafana/agent/pkg/integrations/v2/eventhandler" + "github.com/grafana/river/scanner" +) + +func (b *IntegrationsConfigBuilder) appendEventHandlerV2(config *eventhandler_v2.Config) { + compLabel, err := scanner.SanitizeIdentifier(b.formatJobName(config.Name(), nil)) + if err != nil { + b.diags.Add(diag.SeverityLevelCritical, fmt.Sprintf("failed to sanitize job name: %s", err)) + } + + b.diags.AddAll(common.ValidateSupported(common.NotDeepEquals, config.SendTimeout, eventhandler_v2.DefaultConfig.SendTimeout, "eventhandler send_timeout", "this field is not configurable in flow mode")) + b.diags.AddAll(common.ValidateSupported(common.NotDeepEquals, config.CachePath, eventhandler_v2.DefaultConfig.CachePath, "eventhandler cache_path", "this field is not configurable in flow mode")) + b.diags.AddAll(common.ValidateSupported(common.NotDeepEquals, config.InformerResync, eventhandler_v2.DefaultConfig.InformerResync, "eventhandler informer_resync", "this field is not configurable in flow mode")) + b.diags.AddAll(common.ValidateSupported(common.NotDeepEquals, config.FlushInterval, eventhandler_v2.DefaultConfig.FlushInterval, "eventhandler flush_interval", "this field is not configurable in flow mode")) + + receiver := getLogsReceiver(config) + if len(config.ExtraLabels) > 0 { + receiver = b.injectExtraLabels(config, receiver, compLabel) + } + + args := toEventHandlerV2(config, receiver) + + b.f.Body().AppendBlock(common.NewBlockWithOverride( + []string{"loki", "source", "kubernetes_events"}, + compLabel, + args, + )) +} + +func (b *IntegrationsConfigBuilder) injectExtraLabels(config *eventhandler_v2.Config, receiver common.ConvertLogsReceiver, compLabel string) common.ConvertLogsReceiver { + var relabelConfigs []*flow_relabel.Config + for _, extraLabel := range config.ExtraLabels { + defaultConfig := flow_relabel.DefaultRelabelConfig + relabelConfig := &defaultConfig + relabelConfig.SourceLabels = []string{"__address__"} + relabelConfig.TargetLabel = extraLabel.Name + relabelConfig.Replacement = extraLabel.Value + + relabelConfigs = append(relabelConfigs, relabelConfig) + } + + relabelArgs := relabel.Arguments{ + ForwardTo: []loki.LogsReceiver{receiver}, + RelabelConfigs: relabelConfigs, + MaxCacheSize: relabel.DefaultArguments.MaxCacheSize, + } + + b.f.Body().AppendBlock(common.NewBlockWithOverride( + []string{"loki", "relabel"}, + compLabel, + relabelArgs, + )) + + return common.ConvertLogsReceiver{ + Expr: fmt.Sprintf("loki.relabel.%s.receiver", compLabel), + } +} + +func getLogsReceiver(config *eventhandler_v2.Config) common.ConvertLogsReceiver { + logsReceiver := common.ConvertLogsReceiver{} + if config.LogsInstance != "" { + compLabel, err := scanner.SanitizeIdentifier("logs_" + config.LogsInstance) + if err != nil { + panic(fmt.Errorf("failed to sanitize job name: %s", err)) + } + + logsReceiver.Expr = fmt.Sprintf("loki.write.%s.receiver", compLabel) + } + + return logsReceiver +} + +func toEventHandlerV2(config *eventhandler_v2.Config, receiver common.ConvertLogsReceiver) *kubernetes_events.Arguments { + defaultOverrides := kubernetes_events.DefaultArguments + defaultOverrides.Client.KubeConfig = config.KubeconfigPath + if config.Namespace != "" { + defaultOverrides.Namespaces = []string{config.Namespace} + } + + return &kubernetes_events.Arguments{ + ForwardTo: []loki.LogsReceiver{receiver}, + JobName: kubernetes_events.DefaultArguments.JobName, + Namespaces: defaultOverrides.Namespaces, + LogFormat: config.LogFormat, + Client: defaultOverrides.Client, + } +} diff --git a/converter/internal/staticconvert/testdata-v2/integrations_v2.river b/converter/internal/staticconvert/testdata-v2/integrations_v2.river index 5908cd4f0f5b..d6306565d9e2 100644 --- a/converter/internal/staticconvert/testdata-v2/integrations_v2.river +++ b/converter/internal/staticconvert/testdata-v2/integrations_v2.river @@ -21,6 +21,26 @@ logging { format = "json" } +loki.relabel "integrations_eventhandler" { + forward_to = [loki.write.logs_log_config.receiver] + + rule { + source_labels = ["__address__"] + target_label = "test_label" + replacement = "test_label_value" + } + + rule { + source_labels = ["__address__"] + target_label = "test_label_2" + replacement = "test_label_value_2" + } +} + +loki.source.kubernetes_events "integrations_eventhandler" { + forward_to = [loki.relabel.integrations_eventhandler.receiver] +} + prometheus.exporter.azure "integrations_azure1" { subscriptions = ["subId"] resource_type = "Microsoft.Dashboard/grafana" diff --git a/converter/internal/staticconvert/testdata-v2/integrations_v2.yaml b/converter/internal/staticconvert/testdata-v2/integrations_v2.yaml index a335c87de163..cd0c497d15cc 100644 --- a/converter/internal/staticconvert/testdata-v2/integrations_v2.yaml +++ b/converter/internal/staticconvert/testdata-v2/integrations_v2.yaml @@ -117,6 +117,12 @@ integrations: elasticsearch_configs: - autoscrape: metrics_instance: "default" + eventhandler: + cache_path: "./.eventcache/eventhandler.cache" + logs_instance: "log_config" + extra_labels: + test_label: test_label_value + test_label_2: test_label_value_2 gcp_configs: - project_ids: - diff --git a/converter/internal/staticconvert/testdata-v2/unsupported.diags b/converter/internal/staticconvert/testdata-v2/unsupported.diags index 6337d505766f..cf356c13c1da 100644 --- a/converter/internal/staticconvert/testdata-v2/unsupported.diags +++ b/converter/internal/staticconvert/testdata-v2/unsupported.diags @@ -1,3 +1,6 @@ +(Error) The converter does not support converting the provided eventhandler send_timeout config: this field is not configurable in flow mode +(Error) The converter does not support converting the provided eventhandler cache_path config: this field is not configurable in flow mode +(Error) The converter does not support converting the provided eventhandler informer_resync config: this field is not configurable in flow mode +(Error) The converter does not support converting the provided eventhandler flush_interval config: this field is not configurable in flow mode (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -(Error) The converter does not support converting the provided eventhandler integration. (Error) The converter does not support converting the provided app_agent_receiver traces_instance config. \ No newline at end of file diff --git a/converter/internal/staticconvert/testdata-v2/unsupported.river b/converter/internal/staticconvert/testdata-v2/unsupported.river index 4b78abf71b43..0dcdb9ac79a6 100644 --- a/converter/internal/staticconvert/testdata-v2/unsupported.river +++ b/converter/internal/staticconvert/testdata-v2/unsupported.river @@ -9,6 +9,17 @@ prometheus.remote_write "metrics_default" { } } +loki.write "logs_log_config" { + endpoint { + url = "http://localhost/loki/api/v1/push" + } + external_labels = {} +} + +loki.source.kubernetes_events "integrations_eventhandler" { + forward_to = [loki.write.logs_log_config.receiver] +} + faro.receiver "integrations_app_agent_receiver" { extra_log_labels = {} diff --git a/converter/internal/staticconvert/testdata-v2/unsupported.yaml b/converter/internal/staticconvert/testdata-v2/unsupported.yaml index 13b6c44998ad..dfce6ed22e45 100644 --- a/converter/internal/staticconvert/testdata-v2/unsupported.yaml +++ b/converter/internal/staticconvert/testdata-v2/unsupported.yaml @@ -6,6 +6,13 @@ metrics: configs: - name: default +logs: + positions_directory: /path + configs: + - name: log_config + clients: + - url: http://localhost/loki/api/v1/push + integrations: app_agent_receiver_configs: - instance: "default" @@ -14,4 +21,8 @@ integrations: host: "localhost" port: 55678 eventhandler: - cache_path: "/etc/eventhandler/eventhandler.cache" \ No newline at end of file + cache_path: "/etc/eventhandler/not_default.cache" + logs_instance: "log_config" + send_timeout: 30 + informer_resync: 30 + flush_interval: 30 \ No newline at end of file diff --git a/converter/internal/staticconvert/validate.go b/converter/internal/staticconvert/validate.go index fb714af9d555..2c5aeb87c1d0 100644 --- a/converter/internal/staticconvert/validate.go +++ b/converter/internal/staticconvert/validate.go @@ -37,7 +37,8 @@ import ( apache_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/apache_http" app_agent_receiver_v2 "github.com/grafana/agent/pkg/integrations/v2/app_agent_receiver" blackbox_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/blackbox_exporter" - "github.com/grafana/agent/pkg/integrations/v2/metricsutils" + eventhandler_v2 "github.com/grafana/agent/pkg/integrations/v2/eventhandler" + metricsutils_v2 "github.com/grafana/agent/pkg/integrations/v2/metricsutils" snmp_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/snmp_exporter" vmware_exporter_v2 "github.com/grafana/agent/pkg/integrations/v2/vmware_exporter" "github.com/grafana/agent/pkg/integrations/windows_exporter" @@ -171,9 +172,10 @@ func validateIntegrationsV2(integrationsConfig *v2.SubsystemOptions) diag.Diagno case *app_agent_receiver_v2.Config: diags.AddAll(common.ValidateSupported(common.NotEquals, itg.TracesInstance, "", "app_agent_receiver traces_instance", "")) case *blackbox_exporter_v2.Config: + case *eventhandler_v2.Config: case *snmp_exporter_v2.Config: case *vmware_exporter_v2.Config: - case *metricsutils.ConfigShim: + case *metricsutils_v2.ConfigShim: switch v1_itg := itg.Orig.(type) { case *azure_exporter.Config: case *cadvisor.Config: From 50d16208d1c2f30851212b97ef1fe6e106d499e8 Mon Sep 17 00:00:00 2001 From: Craig Peterson <192540+captncraig@users.noreply.github.com> Date: Thu, 4 Jan 2024 13:47:26 -0500 Subject: [PATCH 12/19] helm: clean up logic for autodelete pvcs (#6042) * helm: clean up logic for autodelete pvcs * remove flag * changelog --- operations/helm/charts/grafana-agent/CHANGELOG.md | 4 ++++ .../ci/create-statefulset-autoscaling-values.yaml | 1 + .../grafana-agent/templates/controllers/statefulset.yaml | 7 +++++-- operations/helm/scripts/rebuild-tests.sh | 2 +- .../grafana-agent/templates/controllers/statefulset.yaml | 3 +++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index 70b612d74572..d14525031740 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -14,6 +14,10 @@ Unreleased - Update `rbac` to include necessary rules for the `otelcol.processor.k8sattributes` component. (@rlankfo) +### Bugfixes + +- Statefulset should use value `.controller.enableStatefulSetAutoDeletePVC` instead of just `.enableStatefulSetAutoDeletePVC`. (@captncraig) + 0.29.0 (2023-11-30) ------------------- diff --git a/operations/helm/charts/grafana-agent/ci/create-statefulset-autoscaling-values.yaml b/operations/helm/charts/grafana-agent/ci/create-statefulset-autoscaling-values.yaml index 89b51fc31c78..eedf5411b31c 100644 --- a/operations/helm/charts/grafana-agent/ci/create-statefulset-autoscaling-values.yaml +++ b/operations/helm/charts/grafana-agent/ci/create-statefulset-autoscaling-values.yaml @@ -3,6 +3,7 @@ controller: type: statefulset autoscaling: enabled: true + enableStatefulSetAutoDeletePVC: true agent: resources: requests: diff --git a/operations/helm/charts/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/charts/grafana-agent/templates/controllers/statefulset.yaml index c4ef55024a22..a4965d14205d 100644 --- a/operations/helm/charts/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/charts/grafana-agent/templates/controllers/statefulset.yaml @@ -1,4 +1,7 @@ {{- if eq .Values.controller.type "statefulset" }} +{{- if .Values.enableStatefulSetAutoDeletePVC }} +{{- fail "Value 'enableStatefulSetAutoDeletePVC' should be nested inside 'controller' options." }} +{{- end }} apiVersion: apps/v1 kind: StatefulSet metadata: @@ -35,8 +38,8 @@ spec: - {{ toYaml . | nindent 6 }} {{- end }} {{- end }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.enableStatefulSetAutoDeletePVC) }} - {{/* + {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.controller.enableStatefulSetAutoDeletePVC) }} + {{- /* Data on the read nodes is easy to replace, so we want to always delete PVCs to make operation easier, and will rely on re-fetching data when needed. */}} diff --git a/operations/helm/scripts/rebuild-tests.sh b/operations/helm/scripts/rebuild-tests.sh index af82eef8b12d..66ce2dfaaff6 100755 --- a/operations/helm/scripts/rebuild-tests.sh +++ b/operations/helm/scripts/rebuild-tests.sh @@ -17,7 +17,7 @@ for chart_file in $(find * -name Chart.yaml -print | sort); do FILENAME=$(basename ${FILE_PATH}) TESTNAME=${FILENAME%-values.yaml} # Render chart - helm template --namespace default --debug ${CHART_NAME} ${CHART_DIR} -f ${FILE_PATH} --output-dir ${TEST_DIR}/${TESTNAME} --set '$chart_tests=true' + helm template --namespace default --kube-version 1.26 --debug ${CHART_NAME} ${CHART_DIR} -f ${FILE_PATH} --output-dir ${TEST_DIR}/${TESTNAME} --set '$chart_tests=true' done fi done diff --git a/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml b/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml index 65ce63ce8c00..06151482680e 100644 --- a/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml +++ b/operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/controllers/statefulset.yaml @@ -76,3 +76,6 @@ spec: - name: config configMap: name: grafana-agent + persistentVolumeClaimRetentionPolicy: + whenDeleted: Delete + whenScaled: Delete From 35b803906c6e37c59cef7dd4ff09c6a6cd24de75 Mon Sep 17 00:00:00 2001 From: Piotr <17101802+thampiotr@users.noreply.github.com> Date: Fri, 5 Jan 2024 11:41:33 +0100 Subject: [PATCH 13/19] Move 'Getting started' to 'Tasks' (#6043) * Move 'Getting started' to 'Tasks' * fix aliases --- docs/sources/about.md | 12 ++++----- .../loki-config.png | Bin .../otlp-lgtm-graph.png | Bin .../prometheus-config.png | Bin .../tempo-config.png | Bin docs/sources/flow/_index.md | 6 ++--- docs/sources/flow/getting-started/_index.md | 19 ------------- docs/sources/flow/reference/cli/convert.md | 6 ++--- docs/sources/flow/tasks/_index.md | 25 ++++++++++++++++++ .../collect-opentelemetry-data.md | 8 +++++- .../collect-prometheus-metrics.md | 8 +++++- .../configure-agent-clustering.md | 8 +++++- .../distribute-prometheus-scrape-load.md | 16 +++++++---- .../migrating-from-operator.md | 6 ++++- .../migrating-from-prometheus.md | 8 +++++- .../migrating-from-promtail.md | 8 +++++- .../migrating-from-static.md | 16 +++++++---- .../opentelemetry-to-lgtm-stack.md | 24 ++++++++++------- 18 files changed, 114 insertions(+), 56 deletions(-) rename docs/sources/assets/{getting-started => tasks}/loki-config.png (100%) rename docs/sources/assets/{getting-started => tasks}/otlp-lgtm-graph.png (100%) rename docs/sources/assets/{getting-started => tasks}/prometheus-config.png (100%) rename docs/sources/assets/{getting-started => tasks}/tempo-config.png (100%) delete mode 100644 docs/sources/flow/getting-started/_index.md create mode 100644 docs/sources/flow/tasks/_index.md rename docs/sources/flow/{getting-started => tasks}/collect-opentelemetry-data.md (95%) rename docs/sources/flow/{getting-started => tasks}/collect-prometheus-metrics.md (96%) rename docs/sources/flow/{getting-started => tasks}/configure-agent-clustering.md (83%) rename docs/sources/flow/{getting-started => tasks}/distribute-prometheus-scrape-load.md (78%) rename docs/sources/flow/{getting-started => tasks}/migrating-from-operator.md (97%) rename docs/sources/flow/{getting-started => tasks}/migrating-from-prometheus.md (95%) rename docs/sources/flow/{getting-started => tasks}/migrating-from-promtail.md (95%) rename docs/sources/flow/{getting-started => tasks}/migrating-from-static.md (95%) rename docs/sources/flow/{getting-started => tasks}/opentelemetry-to-lgtm-stack.md (93%) diff --git a/docs/sources/about.md b/docs/sources/about.md index 0737815b61d6..c33d73087408 100644 --- a/docs/sources/about.md +++ b/docs/sources/about.md @@ -29,12 +29,12 @@ Grafana Agent is available in three different variants: [Static mode Kubernetes operator]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/operator" [Flow mode]: "/docs/agent/ -> /docs/agent//flow" [Flow mode]: "/docs/grafana-cloud/ -> /docs/agent//flow" -[Prometheus]: "/docs/agent/ -> /docs/agent//flow/getting-started/collect-prometheus-metrics.md" -[Prometheus]: "/docs/grafana-cloud/ -> /docs/agent//flow/getting-started/collect-prometheus-metrics.md" -[OTel]: "/docs/agent/ -> /docs/agent//flow/getting-started/collect-opentelemetry-data.md" -[OTel]: "/docs/grafana-cloud/ -> /docs/agent//flow/getting-started/collect-opentelemetry-data.md" -[Loki]: "/docs/agent/ -> /docs/agent//flow/getting-started/migrating-from-promtail.md" -[Loki]: "/docs/grafana-cloud/ -> /docs/agent//flow/getting-started/migrating-from-promtail.md" +[Prometheus]: "/docs/agent/ -> /docs/agent//flow/tasks/collect-prometheus-metrics.md" +[Prometheus]: "/docs/grafana-cloud/ -> /docs/agent//flow/tasks/collect-prometheus-metrics.md" +[OTel]: "/docs/agent/ -> /docs/agent//flow/tasks/collect-opentelemetry-data.md" +[OTel]: "/docs/grafana-cloud/ -> /docs/agent//flow/tasks/collect-opentelemetry-data.md" +[Loki]: "/docs/agent/ -> /docs/agent//flow/tasks/migrating-from-promtail.md" +[Loki]: "/docs/grafana-cloud/ -> /docs/agent//flow/tasks/migrating-from-promtail.md" [clustering]: "/docs/agent/ -> /docs/agent//flow/concepts/clustering/_index.md" [clustering]: "/docs/grafana-cloud/ -> /docs/agent//flow/concepts/clustering/_index.md" [rules]: "/docs/agent/ -> /docs/agent/latest/flow/reference/components/mimir.rules.kubernetes.md" diff --git a/docs/sources/assets/getting-started/loki-config.png b/docs/sources/assets/tasks/loki-config.png similarity index 100% rename from docs/sources/assets/getting-started/loki-config.png rename to docs/sources/assets/tasks/loki-config.png diff --git a/docs/sources/assets/getting-started/otlp-lgtm-graph.png b/docs/sources/assets/tasks/otlp-lgtm-graph.png similarity index 100% rename from docs/sources/assets/getting-started/otlp-lgtm-graph.png rename to docs/sources/assets/tasks/otlp-lgtm-graph.png diff --git a/docs/sources/assets/getting-started/prometheus-config.png b/docs/sources/assets/tasks/prometheus-config.png similarity index 100% rename from docs/sources/assets/getting-started/prometheus-config.png rename to docs/sources/assets/tasks/prometheus-config.png diff --git a/docs/sources/assets/getting-started/tempo-config.png b/docs/sources/assets/tasks/tempo-config.png similarity index 100% rename from docs/sources/assets/getting-started/tempo-config.png rename to docs/sources/assets/tasks/tempo-config.png diff --git a/docs/sources/flow/_index.md b/docs/sources/flow/_index.md index 7458fd016b03..4262238f9020 100644 --- a/docs/sources/flow/_index.md +++ b/docs/sources/flow/_index.md @@ -80,14 +80,14 @@ This feature is experimental, and it doesn't support all River components. * [Install][] {{< param "PRODUCT_NAME" >}}. * Learn about the core [Concepts][] of {{< param "PRODUCT_NAME" >}}. -* Follow our [Getting started][] guides for {{< param "PRODUCT_NAME" >}}. -* Follow our [Tutorials][] to get started with {{< param "PRODUCT_NAME" >}}. +* Follow our [Tutorials][] for hands-on learning of {{< param "PRODUCT_NAME" >}}. +* Consult our [Tasks][] instructions to accomplish common objectives with {{< param "PRODUCT_NAME" >}}. * Check out our [Reference][] documentation to find specific information you might be looking for. [Install]: {{< relref "./setup/install/" >}} [Concepts]: {{< relref "./concepts/" >}} -[Getting started]: {{< relref "./getting-started/" >}} +[Tasks]: {{< relref "./tasks/" >}} [Tutorials]: {{< relref "./tutorials/ ">}} [Reference]: {{< relref "./reference" >}} diff --git a/docs/sources/flow/getting-started/_index.md b/docs/sources/flow/getting-started/_index.md deleted file mode 100644 index bc989084f42b..000000000000 --- a/docs/sources/flow/getting-started/_index.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -aliases: -- /docs/grafana-cloud/agent/flow/getting-started/ -- /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/ -- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/ -- /docs/grafana-cloud/send-data/agent/flow/getting-started/ -- getting_started/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/ -description: Learn how to use Grafana Agent Flow -menuTitle: Get started -title: Get started with Grafana Agent Flow -weight: 200 ---- - -# Get started with {{% param "PRODUCT_NAME" %}} - -This section details guides for getting started with {{< param "PRODUCT_NAME" >}}. - -{{< section >}} diff --git a/docs/sources/flow/reference/cli/convert.md b/docs/sources/flow/reference/cli/convert.md index 88c9628fde31..833341b47752 100644 --- a/docs/sources/flow/reference/cli/convert.md +++ b/docs/sources/flow/reference/cli/convert.md @@ -82,7 +82,7 @@ This includes Prometheus features such as and many supported *_sd_configs. Unsupported features in a source configuration result in [errors]. -Refer to [Migrate from Prometheus to {{< param "PRODUCT_NAME" >}}]({{< relref "../../getting-started/migrating-from-prometheus/" >}}) for a detailed migration guide. +Refer to [Migrate from Prometheus to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrating-from-prometheus/" >}}) for a detailed migration guide. ### Promtail @@ -96,7 +96,7 @@ are supported and can be converted to {{< param "PRODUCT_NAME" >}} configuration If you have unsupported features in a source configuration, you will receive [errors] when you convert to a flow configuration. The converter will also raise warnings for configuration options that may require your attention. -Refer to [Migrate from Promtail to {{< param "PRODUCT_NAME" >}}]({{< relref "../../getting-started/migrating-from-promtail/" >}}) for a detailed migration guide. +Refer to [Migrate from Promtail to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrating-from-promtail/" >}}) for a detailed migration guide. ### Static @@ -113,4 +113,4 @@ flags with a space between each flag, for example `--extra-args="-enable-feature If you have unsupported features in a Static mode source configuration, you will receive [errors][] when you convert to a Flow mode configuration. The converter will also raise warnings for configuration options that may require your attention. -Refer to [Migrate from Grafana Agent Static to {{< param "PRODUCT_NAME" >}}]({{< relref "../../getting-started/migrating-from-static/" >}}) for a detailed migration guide. \ No newline at end of file +Refer to [Migrate from Grafana Agent Static to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrating-from-static/" >}}) for a detailed migration guide. \ No newline at end of file diff --git a/docs/sources/flow/tasks/_index.md b/docs/sources/flow/tasks/_index.md new file mode 100644 index 000000000000..4ca62e8c1331 --- /dev/null +++ b/docs/sources/flow/tasks/_index.md @@ -0,0 +1,25 @@ +--- +aliases: +- /docs/grafana-cloud/agent/flow/tasks/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/ +# Previous page aliases for backwards compatibility: +- /docs/grafana-cloud/agent/flow/getting-started/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/ +- /docs/grafana-cloud/send-data/agent/flow/getting-started/ +- getting_started/ # /docs/agent/latest/flow/getting_started/ +- getting-started/ # /docs/agent/latest/flow/getting-started/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/ +description: How to perform common tasks with Grafana Agent Flow +menuTitle: Tasks +title: Tasks with Grafana Agent Flow +weight: 200 +--- + +# Tasks with {{% param "PRODUCT_NAME" %}} + +This section details how to perform common tasks with {{< param "PRODUCT_NAME" >}}. + +{{< section >}} diff --git a/docs/sources/flow/getting-started/collect-opentelemetry-data.md b/docs/sources/flow/tasks/collect-opentelemetry-data.md similarity index 95% rename from docs/sources/flow/getting-started/collect-opentelemetry-data.md rename to docs/sources/flow/tasks/collect-opentelemetry-data.md index 70dee8041d9f..22248f9f70f9 100644 --- a/docs/sources/flow/getting-started/collect-opentelemetry-data.md +++ b/docs/sources/flow/tasks/collect-opentelemetry-data.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/collect-opentelemetry-data/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/collect-opentelemetry-data/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/collect-opentelemetry-data/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/collect-opentelemetry-data/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/collect-opentelemetry-data/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/collect-opentelemetry-data/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/collect-opentelemetry-data/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/collect-opentelemetry-data/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/collect-opentelemetry-data/ +- ../getting-started/collect-opentelemetry-data/ # /docs/agent/latest/flow/getting-started/collect-opentelemetry-data/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/collect-opentelemetry-data/ description: Learn how to collect OpenTelemetry data title: Collect OpenTelemetry data weight: 300 diff --git a/docs/sources/flow/getting-started/collect-prometheus-metrics.md b/docs/sources/flow/tasks/collect-prometheus-metrics.md similarity index 96% rename from docs/sources/flow/getting-started/collect-prometheus-metrics.md rename to docs/sources/flow/tasks/collect-prometheus-metrics.md index be6d2ce71e01..350ce1ccfd4d 100644 --- a/docs/sources/flow/getting-started/collect-prometheus-metrics.md +++ b/docs/sources/flow/tasks/collect-prometheus-metrics.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/collect-prometheus-metrics/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/collect-prometheus-metrics/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/collect-prometheus-metrics/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/collect-prometheus-metrics/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/collect-prometheus-metrics/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/collect-prometheus-metrics/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/collect-prometheus-metrics/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/collect-prometheus-metrics/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/collect-prometheus-metrics/ +- ../getting-started/collect-prometheus-metrics/ # /docs/agent/latest/flow/getting-started/collect-prometheus-metrics/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/collect-prometheus-metrics/ description: Learn how to collect and forward Prometheus metrics title: Collect and forward Prometheus metrics weight: 200 diff --git a/docs/sources/flow/getting-started/configure-agent-clustering.md b/docs/sources/flow/tasks/configure-agent-clustering.md similarity index 83% rename from docs/sources/flow/getting-started/configure-agent-clustering.md rename to docs/sources/flow/tasks/configure-agent-clustering.md index eacc61407986..b1ab444d4ebb 100644 --- a/docs/sources/flow/getting-started/configure-agent-clustering.md +++ b/docs/sources/flow/tasks/configure-agent-clustering.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/configure-agent-clustering/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/configure-agent-clustering/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/configure-agent-clustering/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/configure-agent-clustering/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/configure-agent-clustering/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/configure-agent-clustering/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/configure-agent-clustering/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/configure-agent-clustering/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/configure-agent-clustering/ +- ../getting-started/configure-agent-clustering/ # /docs/agent/latest/flow/getting-started/configure-agent-clustering/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/configure-agent-clustering/ description: Learn how to configure Grafana Agent clustering in an existing installation menuTitle: Configure Grafana Agent clustering title: Configure Grafana Agent clustering in an existing installation diff --git a/docs/sources/flow/getting-started/distribute-prometheus-scrape-load.md b/docs/sources/flow/tasks/distribute-prometheus-scrape-load.md similarity index 78% rename from docs/sources/flow/getting-started/distribute-prometheus-scrape-load.md rename to docs/sources/flow/tasks/distribute-prometheus-scrape-load.md index d881b2f0a34b..961c98543b98 100644 --- a/docs/sources/flow/getting-started/distribute-prometheus-scrape-load.md +++ b/docs/sources/flow/tasks/distribute-prometheus-scrape-load.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/distribute-prometheus-scrape-load/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/distribute-prometheus-scrape-load/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/distribute-prometheus-scrape-load/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/distribute-prometheus-scrape-load/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/distribute-prometheus-scrape-load/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/distribute-prometheus-scrape-load/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/distribute-prometheus-scrape-load/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/distribute-prometheus-scrape-load/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/distribute-prometheus-scrape-load/ +- ../getting-started/distribute-prometheus-scrape-load/ # /docs/agent/latest/flow/getting-started/distribute-prometheus-scrape-load/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/distribute-prometheus-scrape-load/ description: Learn how to distribute your Prometheus metrics scrape load menuTitle: Distribute Prometheus metrics scrape load title: Distribute Prometheus metrics scrape load @@ -53,10 +59,10 @@ To distribute Prometheus metrics scrape load with clustering: [beta]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/stability.md#beta" [configure-grafana-agent]: "/docs/agent/ -> /docs/agent//flow/setup/configure" [configure-grafana-agent]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/setup/configure" -[Configure Prometheus metrics collection]: "/docs/agent/ -> /docs/agent//flow/getting-started/collect-prometheus-metrics.md" -[Configure Prometheus metrics collection]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/getting-started/collect-prometheus-metrics.md" -[Configure clustering]: "/docs/agent/ -> /docs/agent//flow/getting-started/configure-agent-clustering.md" -[Configure clustering]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/getting-started/configure-agent-clustering.md" +[Configure Prometheus metrics collection]: "/docs/agent/ -> /docs/agent//flow/tasks/collect-prometheus-metrics.md" +[Configure Prometheus metrics collection]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/collect-prometheus-metrics.md" +[Configure clustering]: "/docs/agent/ -> /docs/agent//flow/tasks/configure-agent-clustering.md" +[Configure clustering]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/configure-agent-clustering.md" [UI]: "/docs/agent/ -> /docs/agent//flow/monitoring/debugging.md#component-detail-page" [UI]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/monitoring/debugging.md#component-detail-page" {{% /docs/reference %}} diff --git a/docs/sources/flow/getting-started/migrating-from-operator.md b/docs/sources/flow/tasks/migrating-from-operator.md similarity index 97% rename from docs/sources/flow/getting-started/migrating-from-operator.md rename to docs/sources/flow/tasks/migrating-from-operator.md index 5985488c2915..375ffec59e51 100644 --- a/docs/sources/flow/getting-started/migrating-from-operator.md +++ b/docs/sources/flow/tasks/migrating-from-operator.md @@ -1,8 +1,12 @@ --- aliases: +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-operator/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-operator/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-operator/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-operator/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/migrating-from-operator/ +- ../getting-started/migrating-from-operator/ # /docs/agent/latest/flow/getting-started/migrating-from-operator/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-operator/ description: Migrating from Grafana Agent Operator to Grafana Agent Flow menuTitle: Migrate from Operator title: Migrating from Grafana Agent Operator to Grafana Agent Flow diff --git a/docs/sources/flow/getting-started/migrating-from-prometheus.md b/docs/sources/flow/tasks/migrating-from-prometheus.md similarity index 95% rename from docs/sources/flow/getting-started/migrating-from-prometheus.md rename to docs/sources/flow/tasks/migrating-from-prometheus.md index 8d77d6914340..837ca9da1e07 100644 --- a/docs/sources/flow/getting-started/migrating-from-prometheus.md +++ b/docs/sources/flow/tasks/migrating-from-prometheus.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/migrating-from-prometheus/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-prometheus/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrating-from-prometheus/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-prometheus/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/migrating-from-prometheus/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-prometheus/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/migrating-from-prometheus/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-prometheus/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/migrating-from-prometheus/ +- ../getting-started/migrating-from-prometheus/ # /docs/agent/latest/flow/getting-started/migrating-from-prometheus/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-prometheus/ description: Learn how to migrate from Prometheus to Grafana Agent Flow menuTitle: Migrate from Prometheus title: Migrate from Prometheus to Grafana Agent Flow diff --git a/docs/sources/flow/getting-started/migrating-from-promtail.md b/docs/sources/flow/tasks/migrating-from-promtail.md similarity index 95% rename from docs/sources/flow/getting-started/migrating-from-promtail.md rename to docs/sources/flow/tasks/migrating-from-promtail.md index 4799e0e20b5f..d38e9b904697 100644 --- a/docs/sources/flow/getting-started/migrating-from-promtail.md +++ b/docs/sources/flow/tasks/migrating-from-promtail.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/migrating-from-promtail/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-promtail/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrating-from-promtail/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-promtail/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/migrating-from-promtail/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-promtail/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/migrating-from-promtail/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-promtail/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/migrating-from-promtail/ +- ../getting-started/migrating-from-promtail/ # /docs/agent/latest/flow/getting-started/migrating-from-promtail/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-promtail/ description: Learn how to migrate from Promtail to Grafana Agent Flow menuTitle: Migrate from Promtail title: Migrate from Promtail to Grafana Agent Flow diff --git a/docs/sources/flow/getting-started/migrating-from-static.md b/docs/sources/flow/tasks/migrating-from-static.md similarity index 95% rename from docs/sources/flow/getting-started/migrating-from-static.md rename to docs/sources/flow/tasks/migrating-from-static.md index 8b7b1f98721e..a4033dab096a 100644 --- a/docs/sources/flow/getting-started/migrating-from-static.md +++ b/docs/sources/flow/tasks/migrating-from-static.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/migrating-from-static/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-static/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrating-from-static/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-static/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/migrating-from-static/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-static/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/migrating-from-static/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-static/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/migrating-from-static/ +- ../getting-started/migrating-from-static/ # /docs/agent/latest/flow/getting-started/migrating-from-static/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-static/ description: Learn how to migrate your configuration from Grafana Agent Static to Grafana Agent Flow menuTitle: Migrate from Static to Flow title: Migrate Grafana Agent Static to Grafana Agent Flow @@ -382,10 +388,10 @@ The following list is specific to the convert command and not {{< param "PRODUCT [Agent Management]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/static/configuration/agent-management.md" [env]: "/docs/agent/ -> /docs/agent//flow/reference/stdlib/env.md" [env]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/stdlib/env.md" -[Prometheus Limitations]: "/docs/agent/ -> /docs/agent//flow/getting-started/migrating-from-prometheus.md#limitations" -[Prometheus Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-prometheus.md#limitations" -[Promtail Limitations]: "/docs/agent/ -> /docs/agent//flow/getting-started/migrating-from-promtail.md#limitations" -[Promtail Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-promtail.md#limitations" +[Prometheus Limitations]: "/docs/agent/ -> /docs/agent//flow/tasks/migrating-from-prometheus.md#limitations" +[Prometheus Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-prometheus.md#limitations" +[Promtail Limitations]: "/docs/agent/ -> /docs/agent//flow/tasks/migrating-from-promtail.md#limitations" +[Promtail Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-promtail.md#limitations" [Metrics]: "/docs/agent/ -> /docs/agent//static/configuration/metrics-config.md" [Metrics]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/static/configuration/metrics-config.md" [Logs]: "/docs/agent/ -> /docs/agent//static/configuration/logs-config.md" diff --git a/docs/sources/flow/getting-started/opentelemetry-to-lgtm-stack.md b/docs/sources/flow/tasks/opentelemetry-to-lgtm-stack.md similarity index 93% rename from docs/sources/flow/getting-started/opentelemetry-to-lgtm-stack.md rename to docs/sources/flow/tasks/opentelemetry-to-lgtm-stack.md index 279960d79fe0..2da979078336 100644 --- a/docs/sources/flow/getting-started/opentelemetry-to-lgtm-stack.md +++ b/docs/sources/flow/tasks/opentelemetry-to-lgtm-stack.md @@ -1,10 +1,16 @@ --- aliases: +- /docs/grafana-cloud/agent/flow/tasks/opentelemetry-to-lgtm-stack/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/opentelemetry-to-lgtm-stack/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/opentelemetry-to-lgtm-stack/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/opentelemetry-to-lgtm-stack/ +# Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/opentelemetry-to-lgtm-stack/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/opentelemetry-to-lgtm-stack/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/opentelemetry-to-lgtm-stack/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/opentelemetry-to-lgtm-stack/ -canonical: https://grafana.com/docs/agent/latest/flow/getting-started/opentelemetry-to-lgtm-stack/ +- ../getting-started/opentelemetry-to-lgtm-stack/ # /docs/agent/latest/flow/getting-started/opentelemetry-to-lgtm-stack/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/opentelemetry-to-lgtm-stack/ description: Learn how to collect OpenTelemetry data and forward it to the Grafana stack title: OpenTelemetry to Grafana stack @@ -38,11 +44,11 @@ This topic describes how to: * Have a set of OpenTelemetry applications ready to push telemetry data to {{< param "PRODUCT_NAME" >}}. * Identify where {{< param "PRODUCT_NAME" >}} will write received telemetry data. * Be familiar with the concept of [Components][] in {{< param "PRODUCT_NAME" >}}. -* Complete the [Collect open telemetry data][] getting started guide. You will pick up from where that guide ended. +* Complete the [Collect open telemetry data][] task. You will pick up from where that guide ended. ## The pipeline -You can start with the {{< param "PRODUCT_NAME" >}} configuration you created in the [Collect open telemetry data][] Getting Started guide. +You can start with the {{< param "PRODUCT_NAME" >}} configuration you created in the [Collect open telemetry data][] task. ```river otelcol.receiver.otlp "example" { @@ -108,7 +114,7 @@ loki.write "default" { To use Loki with basic-auth, which is required with Grafana Cloud Loki, you must configure the [loki.write][] component. You can get the Loki configuration from the Loki **Details** page in the [Grafana Cloud Portal][]: -![](../../../assets/getting-started/loki-config.png) +![](../../../assets/tasks/loki-config.png) ```river otelcol.exporter.loki "grafana_cloud_loki" { @@ -143,7 +149,7 @@ otelcol.exporter.otlp "default" { To use Tempo with basic-auth, which is required with Grafana Cloud Tempo, you must use the [otelcol.auth.basic][] component. You can get the Tempo configuration from the Tempo **Details** page in the [Grafana Cloud Portal][]: -![](../../../assets/getting-started/tempo-config.png) +![](../../../assets/tasks/tempo-config.png) ```river otelcol.exporter.otlp "grafana_cloud_tempo" { @@ -180,7 +186,7 @@ prometheus.remote_write "default" { To use Prometheus with basic-auth, which is required with Grafana Cloud Prometheus, you must configure the [prometheus.remote_write][] component. You can get the Prometheus configuration from the Prometheus **Details** page in the [Grafana Cloud Portal][]: -![](../../../assets/getting-started/prometheus-config.png) +![](../../../assets/tasks/prometheus-config.png) ```river otelcol.exporter.prometheus "grafana_cloud_prometheus" { @@ -306,7 +312,7 @@ ts=2023-05-09T09:37:15.304234Z component=otelcol.receiver.otlp.default level=inf You can now check the pipeline graphically by visiting http://localhost:12345/graph -![](../../../assets/getting-started/otlp-lgtm-graph.png) +![](../../../assets/tasks/otlp-lgtm-graph.png) [OpenTelemetry]: https://opentelemetry.io [Grafana Loki]: https://grafana.com/oss/loki/ @@ -316,8 +322,8 @@ You can now check the pipeline graphically by visiting http://localhost:12345/gr [Grafana Mimir]: https://grafana.com/oss/mimir/ {{% docs/reference %}} -[Collect open telemetry data]: "/docs/agent/ -> /docs/agent//flow/getting-started/collect-opentelemetry-data.md" -[Collect open telemetry data]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/getting-started/collect-opentelemetry-data.md" +[Collect open telemetry data]: "/docs/agent/ -> /docs/agent//flow/tasks/collect-opentelemetry-data.md" +[Collect open telemetry data]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/collect-opentelemetry-data.md" [Components]: "/docs/agent/ -> /docs/agent//flow/concepts/components.md" [Components]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/concepts/components.md" [loki.write]: "/docs/agent/ -> /docs/agent//flow/reference/components/loki.write.md" From 404423b7a0d393d53b0adaf1d4e1ddf92f4850a8 Mon Sep 17 00:00:00 2001 From: Paulin Todev Date: Fri, 5 Jan 2024 10:53:34 +0000 Subject: [PATCH 14/19] Remove replace directive for golang.org/x/exp (#5972) * Remove replace directive for golang.org/x/exp * Update pyroscope/ebpf from 0.4.0 to 0.4.1 * Fill in missing docs about HTTP client options. Fix missing defaults. Add an "unsupported" converter diagnostic for keep_dropped_targets. Add HTTP client options to AWS Lightsail SD. * Add discovery.ovhcloud * Add a converter for discovery.ovhcloud * Update cloudwatch_exporter docs * Fix converter tests * Mention Prometheus update in the changelog. --------- Co-authored-by: William Dumont --- CHANGELOG.md | 11 +- component/all/all.go | 1 + component/discovery/aws/ec2.go | 5 +- component/discovery/aws/lightsail.go | 40 +++-- component/discovery/azure/azure.go | 2 + component/discovery/consul/consul.go | 11 +- .../discovery/digitalocean/digitalocean.go | 2 + component/discovery/ovhcloud/ovhcloud.go | 94 ++++++++++ component/discovery/ovhcloud/ovhcloud_test.go | 135 ++++++++++++++ .../prometheusconvert/component/ec2.go | 42 ++--- .../prometheusconvert/component/lightsail.go | 40 ++--- .../prometheusconvert/component/ovhcloud.go | 40 +++++ .../prometheusconvert/component/scrape.go | 5 + .../component/service_discovery.go | 6 + .../prometheusconvert/testdata/azure.river | 6 +- .../prometheusconvert/testdata/consul.river | 8 +- .../testdata/digitalocean.river | 10 +- .../testdata/discovery.river | 4 - .../testdata/discovery_relabel.river | 2 - .../prometheusconvert/testdata/ec2.diags | 1 - .../prometheusconvert/testdata/ec2.river | 5 + .../testdata/lightsail.diags | 1 - .../testdata/lightsail.river | 5 + .../prometheusconvert/testdata/ovhcloud.river | 43 +++++ .../prometheusconvert/testdata/ovhcloud.yaml | 21 +++ .../prometheusconvert/testdata/scrape.diags | 1 + .../prometheusconvert/testdata/scrape.yaml | 2 + .../testdata/unsupported.diags | 1 + .../testdata/unsupported.yaml | 1 + .../promtailconvert/testdata/azure.river | 2 - .../promtailconvert/testdata/consul.river | 2 - .../testdata/digitalocean.river | 2 - .../testdata/prom_remote_write.river | 4 +- .../staticconvert/testdata/prom_scrape.river | 8 +- .../testdata/promtail_prom.river | 8 +- .../flow/reference/compatibility/_index.md | 1 + .../reference/components/discovery.consul.md | 1 + .../reference/components/discovery.docker.md | 1 + .../components/discovery.dockerswarm.md | 1 + .../reference/components/discovery.ec2.md | 29 +++ .../reference/components/discovery.eureka.md | 13 ++ .../reference/components/discovery.hetzner.md | 1 + .../reference/components/discovery.http.md | 15 ++ .../reference/components/discovery.ionos.md | 14 +- .../components/discovery.kubernetes.md | 1 + .../reference/components/discovery.kuma.md | 1 + .../reference/components/discovery.linode.md | 1 + .../components/discovery.marathon.md | 1 + .../reference/components/discovery.nomad.md | 1 + .../components/discovery.ovhcloud.md | 165 ++++++++++++++++++ .../components/discovery.puppetdb.md | 1 + .../prometheus.exporter.cloudwatch.md | 2 + .../reference/components/prometheus.scrape.md | 46 ++--- .../cloudwatch-exporter-config.md | 2 + go.mod | 49 ++---- go.sum | 149 +++++++++------- pkg/metrics/instance/configstore/api_test.go | 1 + pkg/metrics/instance/host_filter_test.go | 1 + pkg/metrics/instance/marshal_test.go | 2 + 59 files changed, 822 insertions(+), 248 deletions(-) create mode 100644 component/discovery/ovhcloud/ovhcloud.go create mode 100644 component/discovery/ovhcloud/ovhcloud_test.go create mode 100644 converter/internal/prometheusconvert/component/ovhcloud.go delete mode 100644 converter/internal/prometheusconvert/testdata/ec2.diags delete mode 100644 converter/internal/prometheusconvert/testdata/lightsail.diags create mode 100644 converter/internal/prometheusconvert/testdata/ovhcloud.river create mode 100644 converter/internal/prometheusconvert/testdata/ovhcloud.yaml create mode 100644 converter/internal/prometheusconvert/testdata/scrape.diags create mode 100644 docs/sources/flow/reference/components/discovery.ovhcloud.md diff --git a/CHANGELOG.md b/CHANGELOG.md index a86d9b1960f6..4d008e4ab023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,10 @@ Main (unreleased) - This change will not break any existing configurations and you can opt in to validation via the `validate_dimensions` configuration option. - Before this change, pulling metrics for azure resources with variable dimensions required one configuration per metric + dimension combination to avoid an error. - After this change, you can include all metrics and dimensions in a single configuration and the Azure APIs will only return dimensions which are valid for the various metrics. + +### Features + +- A new `discovery.ovhcloud` component for discovering scrape targets on OVHcloud. (@ptodev) ### Enhancements @@ -77,6 +81,7 @@ Main (unreleased) - Add `max_cache_size` to `prometheus.relabel` to allow configurability instead of hard coded 100,000. (@mattdurham) - Add support for `http_sd_config` within a `scrape_config` for prometheus to flow config conversion. (@erikbaranowski) +- `discovery.lightsail` now supports additional parameters for configuring HTTP client settings. (@ptodev) ### Bugfixes @@ -100,7 +105,11 @@ Main (unreleased) - Bump github.com/IBM/sarama from v1.41.2 to v1.42.1 -- Attatch unique Agent ID header to remote-write requests. (@captncraig) +- Attach unique Agent ID header to remote-write requests. (@captncraig) + +- Update to v2.48.1 of `github.com/prometheus/prometheus`. + Previously, a custom fork of v2.47.2 was used. + The custom fork of v2.47.2 also contained prometheus#12729 and prometheus#12677. v0.38.1 (2023-11-30) -------------------- diff --git a/component/all/all.go b/component/all/all.go index 3822deee7c9c..b404f27ad4eb 100644 --- a/component/all/all.go +++ b/component/all/all.go @@ -24,6 +24,7 @@ import ( _ "github.com/grafana/agent/component/discovery/nerve" // Import discovery.nerve _ "github.com/grafana/agent/component/discovery/nomad" // Import discovery.nomad _ "github.com/grafana/agent/component/discovery/openstack" // Import discovery.openstack + _ "github.com/grafana/agent/component/discovery/ovhcloud" // Import discovery.ovhcloud _ "github.com/grafana/agent/component/discovery/puppetdb" // Import discovery.puppetdb _ "github.com/grafana/agent/component/discovery/relabel" // Import discovery.relabel _ "github.com/grafana/agent/component/discovery/scaleway" // Import discovery.scaleway diff --git a/component/discovery/aws/ec2.go b/component/discovery/aws/ec2.go index 7672165e05e0..dfc6d00f5d53 100644 --- a/component/discovery/aws/ec2.go +++ b/component/discovery/aws/ec2.go @@ -69,8 +69,9 @@ func (args EC2Arguments) Convert() *promaws.EC2SDConfig { } var DefaultEC2SDConfig = EC2Arguments{ - Port: 80, - RefreshInterval: 60 * time.Second, + Port: 80, + RefreshInterval: 60 * time.Second, + HTTPClientConfig: config.DefaultHTTPClientConfig, } // SetToDefault implements river.Defaulter. diff --git a/component/discovery/aws/lightsail.go b/component/discovery/aws/lightsail.go index 3f47366cc8b7..2b414a54faff 100644 --- a/component/discovery/aws/lightsail.go +++ b/component/discovery/aws/lightsail.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/session" "github.com/grafana/agent/component" + "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/component/discovery" "github.com/grafana/river/rivertypes" promcfg "github.com/prometheus/common/config" @@ -27,34 +28,37 @@ func init() { // LightsailArguments is the configuration for AWS Lightsail based service discovery. type LightsailArguments struct { - Endpoint string `river:"endpoint,attr,optional"` - Region string `river:"region,attr,optional"` - AccessKey string `river:"access_key,attr,optional"` - SecretKey rivertypes.Secret `river:"secret_key,attr,optional"` - Profile string `river:"profile,attr,optional"` - RoleARN string `river:"role_arn,attr,optional"` - RefreshInterval time.Duration `river:"refresh_interval,attr,optional"` - Port int `river:"port,attr,optional"` + Endpoint string `river:"endpoint,attr,optional"` + Region string `river:"region,attr,optional"` + AccessKey string `river:"access_key,attr,optional"` + SecretKey rivertypes.Secret `river:"secret_key,attr,optional"` + Profile string `river:"profile,attr,optional"` + RoleARN string `river:"role_arn,attr,optional"` + RefreshInterval time.Duration `river:"refresh_interval,attr,optional"` + Port int `river:"port,attr,optional"` + HTTPClientConfig config.HTTPClientConfig `river:",squash"` } func (args LightsailArguments) Convert() *promaws.LightsailSDConfig { cfg := &promaws.LightsailSDConfig{ - Endpoint: args.Endpoint, - Region: args.Region, - AccessKey: args.AccessKey, - SecretKey: promcfg.Secret(args.SecretKey), - Profile: args.Profile, - RoleARN: args.RoleARN, - RefreshInterval: model.Duration(args.RefreshInterval), - Port: args.Port, + Endpoint: args.Endpoint, + Region: args.Region, + AccessKey: args.AccessKey, + SecretKey: promcfg.Secret(args.SecretKey), + Profile: args.Profile, + RoleARN: args.RoleARN, + RefreshInterval: model.Duration(args.RefreshInterval), + Port: args.Port, + HTTPClientConfig: *args.HTTPClientConfig.Convert(), } return cfg } // DefaultLightsailSDConfig is the default Lightsail SD configuration. var DefaultLightsailSDConfig = LightsailArguments{ - Port: 80, - RefreshInterval: 60 * time.Second, + Port: 80, + RefreshInterval: 60 * time.Second, + HTTPClientConfig: config.DefaultHTTPClientConfig, } // SetToDefault implements river.Defaulter. diff --git a/component/discovery/azure/azure.go b/component/discovery/azure/azure.go index 3e1ef563625c..9ed1363f5250 100644 --- a/component/discovery/azure/azure.go +++ b/component/discovery/azure/azure.go @@ -55,6 +55,8 @@ var DefaultArguments = Arguments{ Environment: azure.PublicCloud.Name, Port: 80, RefreshInterval: 5 * time.Minute, + FollowRedirects: true, + EnableHTTP2: true, } // SetToDefault implements river.Defaulter. diff --git a/component/discovery/consul/consul.go b/component/discovery/consul/consul.go index 1192bae6c6d2..de6aae2d4510 100644 --- a/component/discovery/consul/consul.go +++ b/component/discovery/consul/consul.go @@ -45,11 +45,12 @@ type Arguments struct { } var DefaultArguments = Arguments{ - Server: "localhost:8500", - TagSeparator: ",", - Scheme: "http", - AllowStale: true, - RefreshInterval: 30 * time.Second, + Server: "localhost:8500", + TagSeparator: ",", + Scheme: "http", + AllowStale: true, + RefreshInterval: 30 * time.Second, + HTTPClientConfig: config.DefaultHTTPClientConfig, } // SetToDefault implements river.Defaulter. diff --git a/component/discovery/digitalocean/digitalocean.go b/component/discovery/digitalocean/digitalocean.go index 360ef70ce818..bde15337da88 100644 --- a/component/discovery/digitalocean/digitalocean.go +++ b/component/discovery/digitalocean/digitalocean.go @@ -39,6 +39,8 @@ type Arguments struct { var DefaultArguments = Arguments{ Port: 80, RefreshInterval: time.Minute, + FollowRedirects: true, + EnableHTTP2: true, } // SetToDefault implements river.Defaulter. diff --git a/component/discovery/ovhcloud/ovhcloud.go b/component/discovery/ovhcloud/ovhcloud.go new file mode 100644 index 000000000000..e3479f45a5f7 --- /dev/null +++ b/component/discovery/ovhcloud/ovhcloud.go @@ -0,0 +1,94 @@ +package ovhcloud + +import ( + "fmt" + "time" + + "github.com/grafana/agent/component" + "github.com/grafana/agent/component/discovery" + "github.com/grafana/river/rivertypes" + "github.com/prometheus/common/config" + "github.com/prometheus/common/model" + prom_discovery "github.com/prometheus/prometheus/discovery/ovhcloud" +) + +func init() { + component.Register(component.Registration{ + Name: "discovery.ovhcloud", + Args: Arguments{}, + Exports: discovery.Exports{}, + + Build: func(opts component.Options, args component.Arguments) (component.Component, error) { + return New(opts, args.(Arguments)) + }, + }) +} + +// Arguments configure the discovery.ovhcloud component. +type Arguments struct { + Endpoint string `river:"endpoint,attr,optional"` + ApplicationKey string `river:"application_key,attr"` + ApplicationSecret rivertypes.Secret `river:"application_secret,attr"` + ConsumerKey rivertypes.Secret `river:"consumer_key,attr"` + RefreshInterval time.Duration `river:"refresh_interval,attr,optional"` + Service string `river:"service,attr"` +} + +// DefaultArguments is used to initialize default values for Arguments. +var DefaultArguments = Arguments{ + Endpoint: "ovh-eu", + RefreshInterval: 60 * time.Second, +} + +// SetToDefault implements river.Defaulter. +func (args *Arguments) SetToDefault() { + *args = DefaultArguments +} + +// Validate implements river.Validator. +func (args *Arguments) Validate() error { + if args.Endpoint == "" { + return fmt.Errorf("endpoint cannot be empty") + } + + if args.ApplicationKey == "" { + return fmt.Errorf("application_key cannot be empty") + } + + if args.ApplicationSecret == "" { + return fmt.Errorf("application_secret cannot be empty") + } + + if args.ConsumerKey == "" { + return fmt.Errorf("consumer_key cannot be empty") + } + + switch args.Service { + case "dedicated_server", "vps": + // Valid value - do nothing. + default: + return fmt.Errorf("unknown service: %v", args.Service) + } + + return nil +} + +// Convert returns the upstream configuration struct. +func (args *Arguments) Convert() *prom_discovery.SDConfig { + return &prom_discovery.SDConfig{ + Endpoint: args.Endpoint, + ApplicationKey: args.ApplicationKey, + ApplicationSecret: config.Secret(args.ApplicationSecret), + ConsumerKey: config.Secret(args.ConsumerKey), + RefreshInterval: model.Duration(args.RefreshInterval), + Service: args.Service, + } +} + +// New returns a new instance of a discovery.ovhcloud component. +func New(opts component.Options, args Arguments) (*discovery.Component, error) { + return discovery.New(opts, args, func(args component.Arguments) (discovery.Discoverer, error) { + newArgs := args.(Arguments) + return prom_discovery.NewDiscovery(newArgs.Convert(), opts.Logger) + }) +} diff --git a/component/discovery/ovhcloud/ovhcloud_test.go b/component/discovery/ovhcloud/ovhcloud_test.go new file mode 100644 index 000000000000..8e579574fc67 --- /dev/null +++ b/component/discovery/ovhcloud/ovhcloud_test.go @@ -0,0 +1,135 @@ +package ovhcloud_test + +import ( + "testing" + "time" + + "github.com/grafana/agent/component/discovery/ovhcloud" + "github.com/grafana/river" + "github.com/prometheus/common/model" + prom_ovh "github.com/prometheus/prometheus/discovery/ovhcloud" + "github.com/stretchr/testify/require" +) + +func TestUnmarshal(t *testing.T) { + tests := []struct { + testName string + cfg string + expected *prom_ovh.SDConfig + errorMsg string + }{ + { + testName: "defaults", + cfg: ` + application_key = "appkey" + application_secret = "appsecret" + consumer_key = "consumerkey" + service = "dedicated_server" + `, + expected: &prom_ovh.SDConfig{ + Endpoint: ovhcloud.DefaultArguments.Endpoint, + ApplicationKey: "appkey", + ApplicationSecret: "appsecret", + ConsumerKey: "consumerkey", + RefreshInterval: model.Duration(ovhcloud.DefaultArguments.RefreshInterval), + Service: "dedicated_server", + }, + }, + { + testName: "explicit", + cfg: ` + endpoint = "custom-endpoint" + refresh_interval = "11m" + application_key = "appkey" + application_secret = "appsecret" + consumer_key = "consumerkey" + service = "vps" + `, + expected: &prom_ovh.SDConfig{ + Endpoint: "custom-endpoint", + ApplicationKey: "appkey", + ApplicationSecret: "appsecret", + ConsumerKey: "consumerkey", + RefreshInterval: model.Duration(11 * time.Minute), + Service: "vps", + }, + }, + { + testName: "empty application key", + cfg: ` + endpoint = "custom-endpoint" + refresh_interval = "11m" + application_key = "" + application_secret = "appsecret" + consumer_key = "consumerkey" + service = "vps" + `, + errorMsg: "application_key cannot be empty", + }, + { + testName: "empty application secret", + cfg: ` + endpoint = "custom-endpoint" + refresh_interval = "11m" + application_key = "appkey" + application_secret = "" + consumer_key = "consumerkey" + service = "vps" + `, + errorMsg: "application_secret cannot be empty", + }, + { + testName: "empty consumer key", + cfg: ` + endpoint = "custom-endpoint" + refresh_interval = "11m" + application_key = "appkey" + application_secret = "appsecret" + consumer_key = "" + service = "vps" + `, + errorMsg: "consumer_key cannot be empty", + }, + { + testName: "empty endpoint", + cfg: ` + endpoint = "" + refresh_interval = "11m" + application_key = "appkey" + application_secret = "appsecret" + consumer_key = "consumerkey" + service = "vps" + `, + errorMsg: "endpoint cannot be empty", + }, + { + testName: "unknown service", + cfg: ` + endpoint = "custom-endpoint" + refresh_interval = "11m" + application_key = "appkey" + application_secret = "appsecret" + consumer_key = "consumerkey" + service = "asdf" + `, + errorMsg: "unknown service: asdf", + }, + } + + for _, tc := range tests { + t.Run(tc.testName, func(t *testing.T) { + var args ovhcloud.Arguments + err := river.Unmarshal([]byte(tc.cfg), &args) + if tc.errorMsg != "" { + require.ErrorContains(t, err, tc.errorMsg) + return + } + + require.NoError(t, err) + + promArgs := args.Convert() + + require.Equal(t, tc.expected, promArgs) + }) + } +} diff --git a/converter/internal/prometheusconvert/component/ec2.go b/converter/internal/prometheusconvert/component/ec2.go index acd89755d165..5edf6ec0bac3 100644 --- a/converter/internal/prometheusconvert/component/ec2.go +++ b/converter/internal/prometheusconvert/component/ec2.go @@ -9,7 +9,6 @@ import ( "github.com/grafana/agent/converter/internal/common" "github.com/grafana/agent/converter/internal/prometheusconvert/build" "github.com/grafana/river/rivertypes" - prom_config "github.com/prometheus/common/config" prom_aws "github.com/prometheus/prometheus/discovery/aws" ) @@ -22,27 +21,7 @@ func appendDiscoveryEC2(pb *build.PrometheusBlocks, label string, sdConfig *prom } func ValidateDiscoveryEC2(sdConfig *prom_aws.EC2SDConfig) diag.Diagnostics { - var diags diag.Diagnostics - - var nilBasicAuth *prom_config.BasicAuth - var nilAuthorization *prom_config.Authorization - var nilOAuth2 *prom_config.OAuth2 - - diags.AddAll(common.ValidateSupported(common.NotEquals, sdConfig.HTTPClientConfig.BasicAuth, nilBasicAuth, "ec2_sd_configs basic_auth", "")) - diags.AddAll(common.ValidateSupported(common.NotEquals, sdConfig.HTTPClientConfig.Authorization, nilAuthorization, "ec2_sd_configs authorization", "")) - diags.AddAll(common.ValidateSupported(common.NotEquals, sdConfig.HTTPClientConfig.OAuth2, nilOAuth2, "ec2_sd_configs oauth2", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.BearerToken, prom_config.DefaultHTTPClientConfig.BearerToken, "ec2_sd_configs bearer_token", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.BearerTokenFile, prom_config.DefaultHTTPClientConfig.BearerTokenFile, "ec2_sd_configs bearer_token_file", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.FollowRedirects, prom_config.DefaultHTTPClientConfig.FollowRedirects, "ec2_sd_configs follow_redirects", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.EnableHTTP2, prom_config.DefaultHTTPClientConfig.EnableHTTP2, "ec2_sd_configs enable_http2", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.ProxyConfig, prom_config.DefaultHTTPClientConfig.ProxyConfig, "ec2_sd_configs proxy", "")) - - // Do a last check in case any of the specific checks missed anything. - if len(diags) == 0 { - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig, prom_config.DefaultHTTPClientConfig, "ec2_sd_configs http_client_config", "")) - } - - return diags + return common.ValidateHttpClientConfig(&sdConfig.HTTPClientConfig) } func toDiscoveryEC2(sdConfig *prom_aws.EC2SDConfig) *aws.EC2Arguments { @@ -51,15 +30,16 @@ func toDiscoveryEC2(sdConfig *prom_aws.EC2SDConfig) *aws.EC2Arguments { } return &aws.EC2Arguments{ - Endpoint: sdConfig.Endpoint, - Region: sdConfig.Region, - AccessKey: sdConfig.AccessKey, - SecretKey: rivertypes.Secret(sdConfig.SecretKey), - Profile: sdConfig.Profile, - RoleARN: sdConfig.RoleARN, - RefreshInterval: time.Duration(sdConfig.RefreshInterval), - Port: sdConfig.Port, - Filters: toEC2Filters(sdConfig.Filters), + Endpoint: sdConfig.Endpoint, + Region: sdConfig.Region, + AccessKey: sdConfig.AccessKey, + SecretKey: rivertypes.Secret(sdConfig.SecretKey), + Profile: sdConfig.Profile, + RoleARN: sdConfig.RoleARN, + RefreshInterval: time.Duration(sdConfig.RefreshInterval), + Port: sdConfig.Port, + Filters: toEC2Filters(sdConfig.Filters), + HTTPClientConfig: *common.ToHttpClientConfig(&sdConfig.HTTPClientConfig), } } diff --git a/converter/internal/prometheusconvert/component/lightsail.go b/converter/internal/prometheusconvert/component/lightsail.go index 10480bd082ff..9a97c2f506b4 100644 --- a/converter/internal/prometheusconvert/component/lightsail.go +++ b/converter/internal/prometheusconvert/component/lightsail.go @@ -9,7 +9,6 @@ import ( "github.com/grafana/agent/converter/internal/common" "github.com/grafana/agent/converter/internal/prometheusconvert/build" "github.com/grafana/river/rivertypes" - prom_config "github.com/prometheus/common/config" prom_aws "github.com/prometheus/prometheus/discovery/aws" ) @@ -22,27 +21,7 @@ func appendDiscoveryLightsail(pb *build.PrometheusBlocks, label string, sdConfig } func ValidateDiscoveryLightsail(sdConfig *prom_aws.LightsailSDConfig) diag.Diagnostics { - var diags diag.Diagnostics - - var nilBasicAuth *prom_config.BasicAuth - var nilAuthorization *prom_config.Authorization - var nilOAuth2 *prom_config.OAuth2 - - diags.AddAll(common.ValidateSupported(common.NotEquals, sdConfig.HTTPClientConfig.BasicAuth, nilBasicAuth, "lightsail_sd_configs basic_auth", "")) - diags.AddAll(common.ValidateSupported(common.NotEquals, sdConfig.HTTPClientConfig.Authorization, nilAuthorization, "lightsail_sd_configs authorization", "")) - diags.AddAll(common.ValidateSupported(common.NotEquals, sdConfig.HTTPClientConfig.OAuth2, nilOAuth2, "lightsail_sd_configs oauth2", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.BearerToken, prom_config.DefaultHTTPClientConfig.BearerToken, "lightsail_sd_configs bearer_token", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.BearerTokenFile, prom_config.DefaultHTTPClientConfig.BearerTokenFile, "lightsail_sd_configs bearer_token_file", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.FollowRedirects, prom_config.DefaultHTTPClientConfig.FollowRedirects, "lightsail_sd_configs follow_redirects", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.EnableHTTP2, prom_config.DefaultHTTPClientConfig.EnableHTTP2, "lightsail_sd_configs enable_http2", "")) - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig.ProxyConfig, prom_config.DefaultHTTPClientConfig.ProxyConfig, "lightsail_sd_configs proxy", "")) - - // Do a last check in case any of the specific checks missed anything. - if len(diags) == 0 { - diags.AddAll(common.ValidateSupported(common.NotDeepEquals, sdConfig.HTTPClientConfig, prom_config.DefaultHTTPClientConfig, "lightsail_sd_configs http_client_config", "")) - } - - return diags + return common.ValidateHttpClientConfig(&sdConfig.HTTPClientConfig) } func toDiscoveryLightsail(sdConfig *prom_aws.LightsailSDConfig) *aws.LightsailArguments { @@ -51,13 +30,14 @@ func toDiscoveryLightsail(sdConfig *prom_aws.LightsailSDConfig) *aws.LightsailAr } return &aws.LightsailArguments{ - Endpoint: sdConfig.Endpoint, - Region: sdConfig.Region, - AccessKey: sdConfig.AccessKey, - SecretKey: rivertypes.Secret(sdConfig.SecretKey), - Profile: sdConfig.Profile, - RoleARN: sdConfig.RoleARN, - RefreshInterval: time.Duration(sdConfig.RefreshInterval), - Port: sdConfig.Port, + Endpoint: sdConfig.Endpoint, + Region: sdConfig.Region, + AccessKey: sdConfig.AccessKey, + SecretKey: rivertypes.Secret(sdConfig.SecretKey), + Profile: sdConfig.Profile, + RoleARN: sdConfig.RoleARN, + RefreshInterval: time.Duration(sdConfig.RefreshInterval), + Port: sdConfig.Port, + HTTPClientConfig: *common.ToHttpClientConfig(&sdConfig.HTTPClientConfig), } } diff --git a/converter/internal/prometheusconvert/component/ovhcloud.go b/converter/internal/prometheusconvert/component/ovhcloud.go new file mode 100644 index 000000000000..f4a59fd525cf --- /dev/null +++ b/converter/internal/prometheusconvert/component/ovhcloud.go @@ -0,0 +1,40 @@ +package component + +import ( + "time" + + "github.com/grafana/agent/component/discovery" + "github.com/grafana/agent/component/discovery/ovhcloud" + "github.com/grafana/agent/converter/diag" + "github.com/grafana/agent/converter/internal/common" + "github.com/grafana/agent/converter/internal/prometheusconvert/build" + "github.com/grafana/river/rivertypes" + prom_discovery "github.com/prometheus/prometheus/discovery/ovhcloud" +) + +func appendDiscoveryOvhcloud(pb *build.PrometheusBlocks, label string, sdConfig *prom_discovery.SDConfig) discovery.Exports { + discoveryOvhcloudArgs := toDiscoveryOvhcloud(sdConfig) + name := []string{"discovery", "ovhcloud"} + block := common.NewBlockWithOverride(name, label, discoveryOvhcloudArgs) + pb.DiscoveryBlocks = append(pb.DiscoveryBlocks, build.NewPrometheusBlock(block, name, label, "", "")) + return common.NewDiscoveryExports("discovery.ovhcloud." + label + ".targets") +} + +func ValidateDiscoveryOvhcloud(sdConfig *prom_discovery.SDConfig) diag.Diagnostics { + return nil +} + +func toDiscoveryOvhcloud(sdConfig *prom_discovery.SDConfig) *ovhcloud.Arguments { + if sdConfig == nil { + return nil + } + + return &ovhcloud.Arguments{ + Endpoint: sdConfig.Endpoint, + ApplicationKey: sdConfig.ApplicationKey, + ApplicationSecret: rivertypes.Secret(sdConfig.ApplicationSecret), + ConsumerKey: rivertypes.Secret(sdConfig.ConsumerKey), + RefreshInterval: time.Duration(sdConfig.RefreshInterval), + Service: sdConfig.Service, + } +} diff --git a/converter/internal/prometheusconvert/component/scrape.go b/converter/internal/prometheusconvert/component/scrape.go index 651e4e2c5bc1..a2005cf85fbb 100644 --- a/converter/internal/prometheusconvert/component/scrape.go +++ b/converter/internal/prometheusconvert/component/scrape.go @@ -30,7 +30,12 @@ func AppendPrometheusScrape(pb *build.PrometheusBlocks, scrapeConfig *prom_confi func ValidatePrometheusScrape(scrapeConfig *prom_config.ScrapeConfig) diag.Diagnostics { var diags diag.Diagnostics + // https://github.com/grafana/agent/pull/5972#discussion_r1441980155 + diags.AddAll(common.ValidateSupported(common.NotEquals, scrapeConfig.TrackTimestampsStaleness, false, "scrape_configs track_timestamps_staleness", "")) + // https://github.com/prometheus/prometheus/commit/40240c9c1cb290fe95f1e61886b23fab860aeacd diags.AddAll(common.ValidateSupported(common.NotEquals, scrapeConfig.NativeHistogramBucketLimit, uint(0), "scrape_configs native_histogram_bucket_limit", "")) + // https://github.com/prometheus/prometheus/pull/12647 + diags.AddAll(common.ValidateSupported(common.NotEquals, scrapeConfig.KeepDroppedTargets, uint(0), "scrape_configs keep_dropped_targets", "")) diags.AddAll(common.ValidateHttpClientConfig(&scrapeConfig.HTTPClientConfig)) return diags diff --git a/converter/internal/prometheusconvert/component/service_discovery.go b/converter/internal/prometheusconvert/component/service_discovery.go index 52780475e63a..69c179f1ef9a 100644 --- a/converter/internal/prometheusconvert/component/service_discovery.go +++ b/converter/internal/prometheusconvert/component/service_discovery.go @@ -25,6 +25,7 @@ import ( prom_marathon "github.com/prometheus/prometheus/discovery/marathon" prom_docker "github.com/prometheus/prometheus/discovery/moby" prom_openstack "github.com/prometheus/prometheus/discovery/openstack" + prom_ovhcloud "github.com/prometheus/prometheus/discovery/ovhcloud" prom_scaleway "github.com/prometheus/prometheus/discovery/scaleway" prom_triton "github.com/prometheus/prometheus/discovery/triton" prom_xds "github.com/prometheus/prometheus/discovery/xds" @@ -100,6 +101,9 @@ func AppendServiceDiscoveryConfig(pb *build.PrometheusBlocks, serviceDiscoveryCo case *prom_docker.DockerSwarmSDConfig: labelCounts["dockerswarm"]++ return appendDiscoveryDockerswarm(pb, common.LabelWithIndex(labelCounts["dockerswarm"]-1, label), sdc) + case *prom_ovhcloud.SDConfig: + labelCounts["ovhcloud"]++ + return appendDiscoveryOvhcloud(pb, common.LabelWithIndex(labelCounts["ovhcloud"]-1, label), sdc) default: return discovery.Exports{} } @@ -151,6 +155,8 @@ func ValidateServiceDiscoveryConfig(serviceDiscoveryConfig prom_discover.Config) return ValidateDiscoveryOpenstack(sdc) case *prom_docker.DockerSwarmSDConfig: return ValidateDiscoveryDockerswarm(sdc) + case *prom_ovhcloud.SDConfig: + return ValidateDiscoveryOvhcloud(sdc) default: var diags diag.Diagnostics diags.Add(diag.SeverityLevelError, fmt.Sprintf("The converter does not support converting the provided %s service discovery.", serviceDiscoveryConfig.Name())) diff --git a/converter/internal/prometheusconvert/testdata/azure.river b/converter/internal/prometheusconvert/testdata/azure.river index 368673474b22..e1bc751bf05d 100644 --- a/converter/internal/prometheusconvert/testdata/azure.river +++ b/converter/internal/prometheusconvert/testdata/azure.river @@ -10,8 +10,6 @@ discovery.azure "prometheus1" { managed_identity { client_id = "client" } - follow_redirects = true - enable_http2 = true } discovery.azure "prometheus2" { @@ -26,8 +24,8 @@ discovery.azure "prometheus2" { managed_identity { client_id = "client" } - proxy_url = "proxy" - enable_http2 = true + proxy_url = "proxy" + follow_redirects = false } prometheus.scrape "prometheus1" { diff --git a/converter/internal/prometheusconvert/testdata/consul.river b/converter/internal/prometheusconvert/testdata/consul.river index b3d7879ed47e..ccf9e8c189c3 100644 --- a/converter/internal/prometheusconvert/testdata/consul.river +++ b/converter/internal/prometheusconvert/testdata/consul.river @@ -1,13 +1,9 @@ discovery.consul "prometheus1" { - services = ["myapp"] - follow_redirects = true - enable_http2 = true + services = ["myapp"] } discovery.consul "prometheus2" { - services = ["otherapp"] - follow_redirects = true - enable_http2 = true + services = ["otherapp"] } prometheus.scrape "prometheus1" { diff --git a/converter/internal/prometheusconvert/testdata/digitalocean.river b/converter/internal/prometheusconvert/testdata/digitalocean.river index 4e39bf9be2c6..27b0629afc15 100644 --- a/converter/internal/prometheusconvert/testdata/digitalocean.river +++ b/converter/internal/prometheusconvert/testdata/digitalocean.river @@ -1,12 +1,6 @@ -discovery.digitalocean "prometheus1" { - follow_redirects = true - enable_http2 = true -} +discovery.digitalocean "prometheus1" { } -discovery.digitalocean "prometheus2" { - follow_redirects = true - enable_http2 = true -} +discovery.digitalocean "prometheus2" { } prometheus.scrape "prometheus1" { targets = concat( diff --git a/converter/internal/prometheusconvert/testdata/discovery.river b/converter/internal/prometheusconvert/testdata/discovery.river index 4ff3cc509ce3..f2c59fa7a4f6 100644 --- a/converter/internal/prometheusconvert/testdata/discovery.river +++ b/converter/internal/prometheusconvert/testdata/discovery.river @@ -10,8 +10,6 @@ discovery.azure "prometheus1" { managed_identity { client_id = "client1" } - follow_redirects = true - enable_http2 = true } discovery.azure "prometheus1_2" { @@ -26,8 +24,6 @@ discovery.azure "prometheus1_2" { managed_identity { client_id = "client2" } - follow_redirects = true - enable_http2 = true } discovery.relabel "prometheus1" { diff --git a/converter/internal/prometheusconvert/testdata/discovery_relabel.river b/converter/internal/prometheusconvert/testdata/discovery_relabel.river index 8d37e5c3a9ad..4b1009886810 100644 --- a/converter/internal/prometheusconvert/testdata/discovery_relabel.river +++ b/converter/internal/prometheusconvert/testdata/discovery_relabel.river @@ -10,8 +10,6 @@ discovery.azure "prometheus2" { managed_identity { client_id = "client" } - follow_redirects = true - enable_http2 = true } discovery.relabel "prometheus1" { diff --git a/converter/internal/prometheusconvert/testdata/ec2.diags b/converter/internal/prometheusconvert/testdata/ec2.diags deleted file mode 100644 index 3301a9ad2213..000000000000 --- a/converter/internal/prometheusconvert/testdata/ec2.diags +++ /dev/null @@ -1 +0,0 @@ -(Error) The converter does not support converting the provided ec2_sd_configs bearer_token_file config. \ No newline at end of file diff --git a/converter/internal/prometheusconvert/testdata/ec2.river b/converter/internal/prometheusconvert/testdata/ec2.river index 22775efe8ed2..d07d133a659b 100644 --- a/converter/internal/prometheusconvert/testdata/ec2.river +++ b/converter/internal/prometheusconvert/testdata/ec2.river @@ -3,6 +3,11 @@ discovery.ec2 "prometheus1" { access_key = "YOUR_ACCESS_KEY" secret_key = "YOUR_SECRET_KEY" port = 8080 + + authorization { + type = "Bearer" + credentials_file = "/tmp/token.file" + } } discovery.ec2 "prometheus2" { diff --git a/converter/internal/prometheusconvert/testdata/lightsail.diags b/converter/internal/prometheusconvert/testdata/lightsail.diags deleted file mode 100644 index 0a96d20e3985..000000000000 --- a/converter/internal/prometheusconvert/testdata/lightsail.diags +++ /dev/null @@ -1 +0,0 @@ -(Error) The converter does not support converting the provided lightsail_sd_configs bearer_token_file config. \ No newline at end of file diff --git a/converter/internal/prometheusconvert/testdata/lightsail.river b/converter/internal/prometheusconvert/testdata/lightsail.river index 754d9c5d39ea..4e1966490532 100644 --- a/converter/internal/prometheusconvert/testdata/lightsail.river +++ b/converter/internal/prometheusconvert/testdata/lightsail.river @@ -3,6 +3,11 @@ discovery.lightsail "prometheus1" { access_key = "YOUR_ACCESS_KEY" secret_key = "YOUR_SECRET_KEY" port = 8080 + + authorization { + type = "Bearer" + credentials_file = "/tmp/token.file" + } } discovery.lightsail "prometheus2" { diff --git a/converter/internal/prometheusconvert/testdata/ovhcloud.river b/converter/internal/prometheusconvert/testdata/ovhcloud.river new file mode 100644 index 000000000000..dff1e85bcee3 --- /dev/null +++ b/converter/internal/prometheusconvert/testdata/ovhcloud.river @@ -0,0 +1,43 @@ +discovery.ovhcloud "prometheus1" { + application_key = "app_key" + application_secret = "app_secret" + consumer_key = "cons_key" + service = "vps" +} + +discovery.ovhcloud "prometheus2" { + endpoint = "ovh-us" + application_key = "app_key_2" + application_secret = "app_secret_2" + consumer_key = "cons_key_2" + refresh_interval = "14m0s" + service = "dedicated_server" +} + +prometheus.scrape "prometheus1" { + targets = concat( + discovery.ovhcloud.prometheus1.targets, + [{ + __address__ = "localhost:9090", + }], + ) + forward_to = [prometheus.remote_write.default.receiver] + job_name = "prometheus1" +} + +prometheus.scrape "prometheus2" { + targets = discovery.ovhcloud.prometheus2.targets + forward_to = [prometheus.remote_write.default.receiver] + job_name = "prometheus2" +} + +prometheus.remote_write "default" { + endpoint { + name = "remote1" + url = "http://remote-write-url1" + + queue_config { } + + metadata_config { } + } +} diff --git a/converter/internal/prometheusconvert/testdata/ovhcloud.yaml b/converter/internal/prometheusconvert/testdata/ovhcloud.yaml new file mode 100644 index 000000000000..2201686989fc --- /dev/null +++ b/converter/internal/prometheusconvert/testdata/ovhcloud.yaml @@ -0,0 +1,21 @@ +scrape_configs: + - job_name: "prometheus1" + static_configs: + - targets: ["localhost:9090"] + ovhcloud_sd_configs: + - application_key: "app_key" + application_secret: "app_secret" + consumer_key: "cons_key" + service: "vps" + - job_name: "prometheus2" + ovhcloud_sd_configs: + - application_key: "app_key_2" + application_secret: "app_secret_2" + consumer_key: "cons_key_2" + service: "dedicated_server" + endpoint: "ovh-us" + refresh_interval: "14m" + +remote_write: + - name: "remote1" + url: "http://remote-write-url1" \ No newline at end of file diff --git a/converter/internal/prometheusconvert/testdata/scrape.diags b/converter/internal/prometheusconvert/testdata/scrape.diags new file mode 100644 index 000000000000..de85de6536cf --- /dev/null +++ b/converter/internal/prometheusconvert/testdata/scrape.diags @@ -0,0 +1 @@ +(Error) The converter does not support converting the provided scrape_configs track_timestamps_staleness config. \ No newline at end of file diff --git a/converter/internal/prometheusconvert/testdata/scrape.yaml b/converter/internal/prometheusconvert/testdata/scrape.yaml index d4b1e7e203c7..54496f296005 100644 --- a/converter/internal/prometheusconvert/testdata/scrape.yaml +++ b/converter/internal/prometheusconvert/testdata/scrape.yaml @@ -6,6 +6,7 @@ global: scrape_configs: - job_name: "prometheus-1" honor_timestamps: false + track_timestamps_staleness: true scrape_interval: 10s scrape_timeout: 5s static_configs: @@ -16,6 +17,7 @@ scrape_configs: username: 'user' password: 'pass' - job_name: "prometheus2" + track_timestamps_staleness: false static_configs: - targets: ["localhost:9091"] - targets: ["localhost:9092"] diff --git a/converter/internal/prometheusconvert/testdata/unsupported.diags b/converter/internal/prometheusconvert/testdata/unsupported.diags index ccdf9bd3da88..966bd0d1e5bf 100644 --- a/converter/internal/prometheusconvert/testdata/unsupported.diags +++ b/converter/internal/prometheusconvert/testdata/unsupported.diags @@ -5,6 +5,7 @@ (Error) The converter does not support converting the provided HTTP Client no_proxy config. (Error) The converter does not support converting the provided nomad service discovery. (Error) The converter does not support converting the provided scrape_configs native_histogram_bucket_limit config. +(Error) The converter does not support converting the provided scrape_configs keep_dropped_targets config. (Error) The converter does not support converting the provided storage config. (Error) The converter does not support converting the provided tracing config. (Error) The converter does not support converting the provided HTTP Client proxy_from_environment config. diff --git a/converter/internal/prometheusconvert/testdata/unsupported.yaml b/converter/internal/prometheusconvert/testdata/unsupported.yaml index bf677c030a39..5d174c36cb8e 100644 --- a/converter/internal/prometheusconvert/testdata/unsupported.yaml +++ b/converter/internal/prometheusconvert/testdata/unsupported.yaml @@ -44,6 +44,7 @@ scrape_configs: - targets: ["localhost:9091"] scrape_classic_histograms: true native_histogram_bucket_limit: 2 + keep_dropped_targets: 1000 remote_write: - name: "remote1" diff --git a/converter/internal/promtailconvert/testdata/azure.river b/converter/internal/promtailconvert/testdata/azure.river index bfbe087b6de4..90a652e05dab 100644 --- a/converter/internal/promtailconvert/testdata/azure.river +++ b/converter/internal/promtailconvert/testdata/azure.river @@ -10,8 +10,6 @@ discovery.azure "fun" { managed_identity { client_id = "client" } - follow_redirects = true - enable_http2 = true } local.file_match "fun" { diff --git a/converter/internal/promtailconvert/testdata/consul.river b/converter/internal/promtailconvert/testdata/consul.river index 20b07e0900b3..72563a502d95 100644 --- a/converter/internal/promtailconvert/testdata/consul.river +++ b/converter/internal/promtailconvert/testdata/consul.river @@ -17,8 +17,6 @@ discovery.consul "fun" { username = "toby" password = "this_password_is_safe_innit?" } - follow_redirects = true - enable_http2 = true } discovery.relabel "fun" { diff --git a/converter/internal/promtailconvert/testdata/digitalocean.river b/converter/internal/promtailconvert/testdata/digitalocean.river index 7308cfa33489..fb71e471c56f 100644 --- a/converter/internal/promtailconvert/testdata/digitalocean.river +++ b/converter/internal/promtailconvert/testdata/digitalocean.river @@ -1,8 +1,6 @@ discovery.digitalocean "fun" { refresh_interval = "10m0s" port = 1234 - follow_redirects = true - enable_http2 = true } local.file_match "fun" { diff --git a/converter/internal/staticconvert/testdata/prom_remote_write.river b/converter/internal/staticconvert/testdata/prom_remote_write.river index df5a9848a234..bc9edcd50834 100644 --- a/converter/internal/staticconvert/testdata/prom_remote_write.river +++ b/converter/internal/staticconvert/testdata/prom_remote_write.river @@ -77,7 +77,7 @@ prometheus.remote_write "metrics_test5_sigv4_explicit" { prometheus.remote_write "metrics_test6_azuread_defaults" { endpoint { - name = "test6_azuread_defaults-50e17f" + name = "test6_azuread_defaults-fbed02" url = "http://localhost:9012/api/prom/push" queue_config { } @@ -94,7 +94,7 @@ prometheus.remote_write "metrics_test6_azuread_defaults" { prometheus.remote_write "metrics_test7_azuread_explicit" { endpoint { - name = "test7_azuread_explicit-0f55f1" + name = "test7_azuread_explicit-416842" url = "http://localhost:9012/api/prom/push" queue_config { } diff --git a/converter/internal/staticconvert/testdata/prom_scrape.river b/converter/internal/staticconvert/testdata/prom_scrape.river index c7db1090e90f..e73fd76733e3 100644 --- a/converter/internal/staticconvert/testdata/prom_scrape.river +++ b/converter/internal/staticconvert/testdata/prom_scrape.river @@ -10,9 +10,7 @@ discovery.azure "metrics_agent_promobee" { managed_identity { client_id = "client" } - proxy_url = "proxy" - follow_redirects = true - enable_http2 = true + proxy_url = "proxy" } discovery.azure "metrics_agent_promobee_2" { @@ -27,9 +25,7 @@ discovery.azure "metrics_agent_promobee_2" { managed_identity { client_id = "client" } - proxy_url = "proxy" - follow_redirects = true - enable_http2 = true + proxy_url = "proxy" } discovery.relabel "metrics_agent_promobee" { diff --git a/converter/internal/staticconvert/testdata/promtail_prom.river b/converter/internal/staticconvert/testdata/promtail_prom.river index f3b810dbe704..e31469f5267b 100644 --- a/converter/internal/staticconvert/testdata/promtail_prom.river +++ b/converter/internal/staticconvert/testdata/promtail_prom.river @@ -1,7 +1,5 @@ discovery.consul "metrics_name_jobName" { - services = ["myapp"] - follow_redirects = true - enable_http2 = true + services = ["myapp"] } prometheus.scrape "metrics_name_jobName" { @@ -48,8 +46,6 @@ discovery.consul "logs_name_jobName" { username = "toby" password = "this_password_is_safe_innit?" } - follow_redirects = true - enable_http2 = true } discovery.relabel "logs_name_jobName" { @@ -101,8 +97,6 @@ discovery.consul "logs_name2_jobName" { username = "toby" password = "this_password_is_safe_innit?" } - follow_redirects = true - enable_http2 = true } discovery.relabel "logs_name2_jobName" { diff --git a/docs/sources/flow/reference/compatibility/_index.md b/docs/sources/flow/reference/compatibility/_index.md index 9e225aa74b71..96539228f434 100644 --- a/docs/sources/flow/reference/compatibility/_index.md +++ b/docs/sources/flow/reference/compatibility/_index.md @@ -68,6 +68,7 @@ The following components, grouped by namespace, _export_ Targets. - [discovery.nerve]({{< relref "../components/discovery.nerve.md" >}}) - [discovery.nomad]({{< relref "../components/discovery.nomad.md" >}}) - [discovery.openstack]({{< relref "../components/discovery.openstack.md" >}}) +- [discovery.ovhcloud]({{< relref "../components/discovery.ovhcloud.md" >}}) - [discovery.puppetdb]({{< relref "../components/discovery.puppetdb.md" >}}) - [discovery.relabel]({{< relref "../components/discovery.relabel.md" >}}) - [discovery.scaleway]({{< relref "../components/discovery.scaleway.md" >}}) diff --git a/docs/sources/flow/reference/components/discovery.consul.md b/docs/sources/flow/reference/components/discovery.consul.md index 7737131a6aa8..c63f94b8017c 100644 --- a/docs/sources/flow/reference/components/discovery.consul.md +++ b/docs/sources/flow/reference/components/discovery.consul.md @@ -70,6 +70,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.docker.md b/docs/sources/flow/reference/components/discovery.docker.md index a9143373e12b..4d6ce94d557f 100644 --- a/docs/sources/flow/reference/components/discovery.docker.md +++ b/docs/sources/flow/reference/components/discovery.docker.md @@ -60,6 +60,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.dockerswarm.md b/docs/sources/flow/reference/components/discovery.dockerswarm.md index f6db10bd440c..58c065fb06eb 100644 --- a/docs/sources/flow/reference/components/discovery.dockerswarm.md +++ b/docs/sources/flow/reference/components/discovery.dockerswarm.md @@ -48,6 +48,7 @@ The following blocks are supported inside the definition of | authorization | [authorization][] | Configure generic authorization to the endpoint. | no | | oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no | | oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no | +| tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no | The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.ec2.md b/docs/sources/flow/reference/components/discovery.ec2.md index e2964d2df0a3..7f01ae48c6e0 100644 --- a/docs/sources/flow/reference/components/discovery.ec2.md +++ b/docs/sources/flow/reference/components/discovery.ec2.md @@ -39,6 +39,15 @@ Name | Type | Description | Default | Required `proxy_url` | `string` | HTTP proxy to proxy requests through. | | no `follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no `enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no +`bearer_token` | `secret` | Bearer token to authenticate with. | | no +`bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no + + At most one of the following can be provided: + - [`bearer_token` argument](#arguments). + - [`bearer_token_file` argument](#arguments). + - [`basic_auth` block][basic_auth]. + - [`authorization` block][authorization]. + - [`oauth2` block][oauth2]. ## Blocks @@ -47,9 +56,21 @@ The following blocks are supported inside the definition of Hierarchy | Block | Description | Required --------- | ----- | ----------- | -------- +basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the endpoint. | no +authorization | [authorization][] | Configure generic authorization to the endpoint. | no filter | [filter][] | Filters discoverable resources. | no +oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no +oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no [filter]: #filter-block +[authorization]: #authorization-block +[oauth2]: #oauth2-block +[tls_config]: #tls_config-block + +### authorization block + +{{< docs/shared lookup="flow/reference/components/authorization-block.md" source="agent" version="" >}} ### filter block @@ -65,6 +86,14 @@ Refer to the [Filter API AWS EC2 documentation][filter api] for the list of supp [filter api]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Filter.html +### oauth2 block + +{{< docs/shared lookup="flow/reference/components/oauth2-block.md" source="agent" version="" >}} + +### tls_config block + +{{< docs/shared lookup="flow/reference/components/tls-config-block.md" source="agent" version="" >}} + ## Exported fields The following fields are exported and can be referenced by other components: diff --git a/docs/sources/flow/reference/components/discovery.eureka.md b/docs/sources/flow/reference/components/discovery.eureka.md index 952e90af1ce4..70ab3f8f666d 100644 --- a/docs/sources/flow/reference/components/discovery.eureka.md +++ b/docs/sources/flow/reference/components/discovery.eureka.md @@ -32,8 +32,20 @@ Name | Type | Description `server` | `string` | Eureka server URL. | | yes `refresh_interval` | `duration` | Interval at which to refresh the list of targets. | `30s` | no `enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no +`bearer_token` | `secret` | Bearer token to authenticate with. | | no +`bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no +`proxy_url` | `string` | HTTP proxy to proxy requests through. | | no `follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no + At most one of the following can be provided: + - [`bearer_token` argument](#arguments). + - [`bearer_token_file` argument](#arguments). + - [`basic_auth` block][basic_auth]. + - [`authorization` block][authorization]. + - [`oauth2` block][oauth2]. + +[arguments]: #arguments + ## Blocks The following blocks are supported inside the definition of `discovery.eureka`: @@ -44,6 +56,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.hetzner.md b/docs/sources/flow/reference/components/discovery.hetzner.md index ce92bda3cb2d..c6922e685f66 100644 --- a/docs/sources/flow/reference/components/discovery.hetzner.md +++ b/docs/sources/flow/reference/components/discovery.hetzner.md @@ -62,6 +62,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.http.md b/docs/sources/flow/reference/components/discovery.http.md index 17be475edbc9..50ecf42dcc06 100644 --- a/docs/sources/flow/reference/components/discovery.http.md +++ b/docs/sources/flow/reference/components/discovery.http.md @@ -94,6 +94,20 @@ Name | Type | Description --------------- | ------------------- | ------------------------------------------------------------------------------------------ |---------| -------- `url` | string | URL to scrape | | yes `refresh_interval` | `duration` | How often to refresh targets. | `"60s"` | no +`bearer_token` | `secret` | Bearer token to authenticate with. | | no +`bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no +`proxy_url` | `string` | HTTP proxy to proxy requests through. | | no +`follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no +`enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no + + At most one of the following can be provided: + - [`bearer_token` argument](#arguments). + - [`bearer_token_file` argument](#arguments). + - [`basic_auth` block][basic_auth]. + - [`authorization` block][authorization]. + - [`oauth2` block][oauth2]. + +[arguments]: #arguments ## Blocks @@ -106,6 +120,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.ionos.md b/docs/sources/flow/reference/components/discovery.ionos.md index e06658b4b5d5..1c619a1641ac 100644 --- a/docs/sources/flow/reference/components/discovery.ionos.md +++ b/docs/sources/flow/reference/components/discovery.ionos.md @@ -31,11 +31,22 @@ The following arguments are supported: | ------------------ | ---------- | ------------------------------------------------------------ | ------- | -------- | | `datacenter_id` | `string` | The unique ID of the data center. | | yes | | `refresh_interval` | `duration` | The time after which the servers are refreshed. | `60s` | no | -| `port` | `int` | The port to scrap metrics from. | 80 | no | +| `port` | `int` | The port to scrape metrics from. | 80 | no | +| `bearer_token` | `secret` | Bearer token to authenticate with. | | no | +| `bearer_token_file`| `string` | File containing a bearer token to authenticate with. | | no | | `proxy_url` | `string` | HTTP proxy to proxy requests through. | | no | | `enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no | | `follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no | + At most one of the following can be provided: + - [`bearer_token` argument](#arguments). + - [`bearer_token_file` argument](#arguments). + - [`basic_auth` block][basic_auth]. + - [`authorization` block][authorization]. + - [`oauth2` block][oauth2]. + +[arguments]: #arguments + ## Blocks The following blocks are supported inside the definition of @@ -47,6 +58,7 @@ The following blocks are supported inside the definition of | authorization | [authorization][] | Configure generic authorization to the endpoint. | no | | oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no | | oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no | +| tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no | The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.kubernetes.md b/docs/sources/flow/reference/components/discovery.kubernetes.md index 49ecbd09ea12..1d4b2f9210c5 100644 --- a/docs/sources/flow/reference/components/discovery.kubernetes.md +++ b/docs/sources/flow/reference/components/discovery.kubernetes.md @@ -259,6 +259,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.kuma.md b/docs/sources/flow/reference/components/discovery.kuma.md index bef9a8ccee12..c498753f58ab 100644 --- a/docs/sources/flow/reference/components/discovery.kuma.md +++ b/docs/sources/flow/reference/components/discovery.kuma.md @@ -54,6 +54,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.linode.md b/docs/sources/flow/reference/components/discovery.linode.md index f9f4b1e4e19a..77d01dbdf4e2 100644 --- a/docs/sources/flow/reference/components/discovery.linode.md +++ b/docs/sources/flow/reference/components/discovery.linode.md @@ -54,6 +54,7 @@ Hierarchy | Block | Description | Required authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.marathon.md b/docs/sources/flow/reference/components/discovery.marathon.md index 4327dc502fb1..b19ddb321c2c 100644 --- a/docs/sources/flow/reference/components/discovery.marathon.md +++ b/docs/sources/flow/reference/components/discovery.marathon.md @@ -56,6 +56,7 @@ The following blocks are supported inside the definition of | authorization | [authorization][] | Configure generic authorization to the endpoint. | no | | oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no | | oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no | +| tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no | The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.nomad.md b/docs/sources/flow/reference/components/discovery.nomad.md index c8bcdae99699..aebd128bb320 100644 --- a/docs/sources/flow/reference/components/discovery.nomad.md +++ b/docs/sources/flow/reference/components/discovery.nomad.md @@ -58,6 +58,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/discovery.ovhcloud.md b/docs/sources/flow/reference/components/discovery.ovhcloud.md new file mode 100644 index 000000000000..453fcb3c1cfc --- /dev/null +++ b/docs/sources/flow/reference/components/discovery.ovhcloud.md @@ -0,0 +1,165 @@ +--- +aliases: +- /docs/grafana-cloud/agent/flow/reference/components/discovery.ovhcloud/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/reference/components/discovery.ovhcloud/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/reference/components/discovery.ovhcloud/ +- /docs/grafana-cloud/send-data/agent/flow/reference/components/discovery.ovhcloud/ +canonical: https://grafana.com/docs/agent/latest/flow/reference/components/discovery.ovhcloud/ +description: Learn about discovery.ovhcloud +title: discovery.ovhcloud +--- + +# discovery.ovhcloud + +`discovery.ovhcloud` discovers scrape targets from OVHcloud's [dedicated servers][] and [VPS][] using their [API][]. +{{< param "PRODUCT_ROOT_NAME" >}} will periodically check the REST endpoint and create a target for every discovered server. +The public IPv4 address will be used by default - if there's none, the IPv6 address will be used. +This may be changed via relabeling with `discovery.relabel`. +For OVHcloud's [public cloud][] instances you can use `discovery.openstack`. + +[API]: https://api.ovh.com/ +[public cloud]: https://www.ovhcloud.com/en/public-cloud/ +[VPS]: https://www.ovhcloud.com/en/vps/ +[Dedicated servers]: https://www.ovhcloud.com/en/bare-metal/ + +## Usage + +```river +discovery.ovhcloud "LABEL" { + application_key = APPLICATION_KEY + application_secret = APPLICATION_SECRET + consumer_key = CONSUMER_KEY + service = SERVICE +} +``` + +## Arguments + +The following arguments are supported: + +Name | Type | Description | Default | Required +------------------ | -------------- | -------------------------------------------------------------- | ------------- | -------- +application_key | `string` | [API][] application key. | | yes +application_secret | `secret` | [API][] application secret. | | yes +consumer_key | `secret` | [API][] consumer key. | | yes +endpoint | `string` | [API][] endpoint. | "ovh-eu" | no +refresh_interval | `duration` | Refresh interval to re-read the resources list. | "60s" | no +service | `string` | Service of the targets to retrieve. | | yes + +`endpoint` must be one of the [supported API endpoints][supported-apis]. + +`service` must be either `vps` or `dedicated_server`. + +[supported-apis]: https://github.com/ovh/go-ovh#supported-apis + +## Exported fields + +The following fields are exported and can be referenced by other components: + +Name | Type | Description +--------- | ------------------- | ----------- +`targets` | `list(map(string))` | The set of targets discovered from the OVHcloud API. + +Multiple meta labels are available on `targets` and can be used by the `discovery.relabel` component. + +[VPS][] meta labels: +* `__meta_ovhcloud_vps_cluster`: the cluster of the server. +* `__meta_ovhcloud_vps_datacenter`: the datacenter of the server. +* `__meta_ovhcloud_vps_disk`: the disk of the server. +* `__meta_ovhcloud_vps_display_name`: the display name of the server. +* `__meta_ovhcloud_vps_ipv4`: the IPv4 of the server. +* `__meta_ovhcloud_vps_ipv6`: the IPv6 of the server. +* `__meta_ovhcloud_vps_keymap`: the KVM keyboard layout of the server. +* `__meta_ovhcloud_vps_maximum_additional_ip`: the maximum additional IPs of the server. +* `__meta_ovhcloud_vps_memory_limit`: the memory limit of the server. +* `__meta_ovhcloud_vps_memory`: the memory of the server. +* `__meta_ovhcloud_vps_monitoring_ip_blocks`: the monitoring IP blocks of the server. +* `__meta_ovhcloud_vps_name`: the name of the server. +* `__meta_ovhcloud_vps_netboot_mode`: the netboot mode of the server. +* `__meta_ovhcloud_vps_offer_type`: the offer type of the server. +* `__meta_ovhcloud_vps_offer`: the offer of the server. +* `__meta_ovhcloud_vps_state`: the state of the server. +* `__meta_ovhcloud_vps_vcore`: the number of virtual cores of the server. +* `__meta_ovhcloud_vps_version`: the version of the server. +* `__meta_ovhcloud_vps_zone`: the zone of the server. + +[Dedicated servers][] meta labels: +* `__meta_ovhcloud_dedicated_server_commercial_range`: the commercial range of the server. +* `__meta_ovhcloud_dedicated_server_datacenter`: the datacenter of the server. +* `__meta_ovhcloud_dedicated_server_ipv4`: the IPv4 of the server. +* `__meta_ovhcloud_dedicated_server_ipv6`: the IPv6 of the server. +* `__meta_ovhcloud_dedicated_server_link_speed`: the link speed of the server. +* `__meta_ovhcloud_dedicated_server_name`: the name of the server. +* `__meta_ovhcloud_dedicated_server_os`: the operating system of the server. +* `__meta_ovhcloud_dedicated_server_rack`: the rack of the server. +* `__meta_ovhcloud_dedicated_server_reverse`: the reverse DNS name of the server. +* `__meta_ovhcloud_dedicated_server_server_id`: the ID of the server. +* `__meta_ovhcloud_dedicated_server_state`: the state of the server. +* `__meta_ovhcloud_dedicated_server_support_level`: the support level of the server. + +## Component health + +`discovery.ovhcloud` is only reported as unhealthy when given an invalid +configuration. In those cases, exported fields retain their last healthy +values. + +## Debug information + +`discovery.ovhcloud` does not expose any component-specific debug information. + +## Debug metrics + +`discovery.ovhcloud` does not expose any component-specific debug metrics. + +## Example + +```river +discovery.ovhcloud "example" { + application_key = APPLICATION_KEY + application_secret = APPLICATION_SECRET + consumer_key = CONSUMER_KEY + service = SERVICE +} + +prometheus.scrape "demo" { + targets = discovery.ovhcloud.example.targets + forward_to = [prometheus.remote_write.demo.receiver] +} + +prometheus.remote_write "demo" { + endpoint { + url = PROMETHEUS_REMOTE_WRITE_URL + basic_auth { + username = USERNAME + password = PASSWORD + } + } +} +``` + +Replace the following: + - `APPLICATION_KEY`: The OVHcloud [API][] application key. + - `APPLICATION_SECRET`: The OVHcloud [API][] application secret. + - `CONSUMER_KEY`: The OVHcloud [API][] consumer key. + - `SERVICE`: The OVHcloud service of the targets to retrieve. + - `PROMETHEUS_REMOTE_WRITE_URL`: The URL of the Prometheus remote_write-compatible server to send metrics to. + - `USERNAME`: The username to use for authentication to the remote_write API. + - `PASSWORD`: The password to use for authentication to the remote_write API. + + + + +## Compatible components + +`discovery.ovhcloud` has exports that can be consumed by the following components: + +- Components that consume [Targets]({{< relref "../compatibility/#targets-consumers" >}}) + +{{% admonition type="note" %}} + +Connecting some components may not be sensible or components may require further configuration to make the +connection work correctly. Refer to the linked documentation for more details. + +{{% /admonition %}} + + diff --git a/docs/sources/flow/reference/components/discovery.puppetdb.md b/docs/sources/flow/reference/components/discovery.puppetdb.md index 34e6f14db7c3..a83d8454723c 100644 --- a/docs/sources/flow/reference/components/discovery.puppetdb.md +++ b/docs/sources/flow/reference/components/discovery.puppetdb.md @@ -64,6 +64,7 @@ basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the end authorization | [authorization][] | Configure generic authorization to the endpoint. | no oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no +tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no The `>` symbol indicates deeper levels of nesting. For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside diff --git a/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md b/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md index 10313796d1cb..2c1682a5fccc 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md @@ -429,6 +429,7 @@ discovery job, the `type` field of each `discovery_job` must match either the de - Namespace: `AWS/PrivateLinkEndpoints` or Alias: `vpc-endpoint` - Namespace: `AWS/PrivateLinkServices` or Alias: `vpc-endpoint-service` - Namespace: `AWS/Prometheus` or Alias: `amp` +- Namespace: `AWS/QLDB` or Alias: `qldb` - Namespace: `AWS/RDS` or Alias: `rds` - Namespace: `AWS/Redshift` or Alias: `redshift` - Namespace: `AWS/Route53Resolver` or Alias: `route53-resolver` @@ -442,6 +443,7 @@ discovery job, the `type` field of each `discovery_job` must match either the de - Namespace: `AWS/TransitGateway` or Alias: `tgw` - Namespace: `AWS/TrustedAdvisor` or Alias: `trustedadvisor` - Namespace: `AWS/VPN` or Alias: `vpn` +- Namespace: `AWS/ClientVPN` or Alias: `clientvpn` - Namespace: `AWS/WAFV2` or Alias: `wafv2` - Namespace: `AWS/WorkSpaces` or Alias: `workspaces` - Namespace: `AWS/AOSS` or Alias: `aoss` diff --git a/docs/sources/flow/reference/components/prometheus.scrape.md b/docs/sources/flow/reference/components/prometheus.scrape.md index 08b009c88711..8adf775687f1 100644 --- a/docs/sources/flow/reference/components/prometheus.scrape.md +++ b/docs/sources/flow/reference/components/prometheus.scrape.md @@ -44,30 +44,30 @@ The following arguments are supported: Name | Type | Description | Default | Required ---- | ---- | ----------- | ------- | -------- -`targets` | `list(map(string))` | List of targets to scrape. | | yes -`forward_to` | `list(MetricsReceiver)` | List of receivers to send scraped metrics to. | | yes -`job_name` | `string` | The value to use for the job label if not already set. | component name | no -`extra_metrics` | `bool` | Whether extra metrics should be generated for scrape targets. | `false` | no +`targets` | `list(map(string))` | List of targets to scrape. | | yes +`forward_to` | `list(MetricsReceiver)` | List of receivers to send scraped metrics to. | | yes +`job_name` | `string` | The value to use for the job label if not already set. | component name | no +`extra_metrics` | `bool` | Whether extra metrics should be generated for scrape targets. | `false` | no `enable_protobuf_negotiation` | `bool` | Whether to enable protobuf negotiation with the client. | `false` | no -`honor_labels` | `bool` | Indicator whether the scraped metrics should remain unmodified. | `false` | no -`honor_timestamps` | `bool` | Indicator whether the scraped timestamps should be respected. | `true` | no -`params` | `map(list(string))` | A set of query parameters with which the target is scraped. | | no -`scrape_classic_histograms` | `bool` | Whether to scrape a classic histogram that is also exposed as a native histogram. | `false` | no -`scrape_interval` | `duration` | How frequently to scrape the targets of this scrape configuration. | `"60s"` | no -`scrape_timeout` | `duration` | The timeout for scraping targets of this configuration. | `"10s"` | no -`metrics_path` | `string` | The HTTP resource path on which to fetch metrics from targets. | `/metrics` | no -`scheme` | `string` | The URL scheme with which to fetch metrics from targets. | | no -`body_size_limit` | `int` | An uncompressed response body larger than this many bytes causes the scrape to fail. 0 means no limit. | | no -`sample_limit` | `uint` | More than this many samples post metric-relabeling causes the scrape to fail | | no -`target_limit` | `uint` | More than this many targets after the target relabeling causes the scrapes to fail. | | no -`label_limit` | `uint` | More than this many labels post metric-relabeling causes the scrape to fail. | | no -`label_name_length_limit` | `uint` | More than this label name length post metric-relabeling causes the scrape to fail. | | no -`label_value_length_limit` | `uint` | More than this label value length post metric-relabeling causes the scrape to fail. | | no -`bearer_token` | `secret` | Bearer token to authenticate with. | | no -`bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no -`proxy_url` | `string` | HTTP proxy to proxy requests through. | | no -`follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no -`enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no +`honor_labels` | `bool` | Indicator whether the scraped metrics should remain unmodified. | `false` | no +`honor_timestamps` | `bool` | Indicator whether the scraped timestamps should be respected. | `true` | no +`params` | `map(list(string))` | A set of query parameters with which the target is scraped. | | no +`scrape_classic_histograms` | `bool` | Whether to scrape a classic histogram that is also exposed as a native histogram. | `false` | no +`scrape_interval` | `duration` | How frequently to scrape the targets of this scrape configuration. | `"60s"` | no +`scrape_timeout` | `duration` | The timeout for scraping targets of this configuration. | `"10s"` | no +`metrics_path` | `string` | The HTTP resource path on which to fetch metrics from targets. | `/metrics` | no +`scheme` | `string` | The URL scheme with which to fetch metrics from targets. | | no +`body_size_limit` | `int` | An uncompressed response body larger than this many bytes causes the scrape to fail. 0 means no limit. | | no +`sample_limit` | `uint` | More than this many samples post metric-relabeling causes the scrape to fail | | no +`target_limit` | `uint` | More than this many targets after the target relabeling causes the scrapes to fail. | | no +`label_limit` | `uint` | More than this many labels post metric-relabeling causes the scrape to fail. | | no +`label_name_length_limit` | `uint` | More than this label name length post metric-relabeling causes the scrape to fail. | | no +`label_value_length_limit` | `uint` | More than this label value length post metric-relabeling causes the scrape to fail. | | no +`bearer_token` | `secret` | Bearer token to authenticate with. | | no +`bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no +`proxy_url` | `string` | HTTP proxy to proxy requests through. | | no +`follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no +`enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no At most one of the following can be provided: - [`bearer_token` argument](#arguments). diff --git a/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md b/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md index 8015bde84bc9..6495625b76c8 100644 --- a/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md +++ b/docs/sources/static/configuration/integrations/cloudwatch-exporter-config.md @@ -440,6 +440,7 @@ discovery job, the `type` field of each `discovery_job` must match either the de - Namespace: `AWS/PrivateLinkEndpoints` or Alias: `vpc-endpoint` - Namespace: `AWS/PrivateLinkServices` or Alias: `vpc-endpoint-service` - Namespace: `AWS/Prometheus` or Alias: `amp` +- Namespace: `AWS/QLDB` or Alias: `qldb` - Namespace: `AWS/RDS` or Alias: `rds` - Namespace: `AWS/Redshift` or Alias: `redshift` - Namespace: `AWS/Route53Resolver` or Alias: `route53-resolver` @@ -453,6 +454,7 @@ discovery job, the `type` field of each `discovery_job` must match either the de - Namespace: `AWS/TransitGateway` or Alias: `tgw` - Namespace: `AWS/TrustedAdvisor` or Alias: `trustedadvisor` - Namespace: `AWS/VPN` or Alias: `vpn` +- Namespace: `AWS/ClientVPN` or Alias: `clientvpn` - Namespace: `AWS/WAFV2` or Alias: `wafv2` - Namespace: `AWS/WorkSpaces` or Alias: `workspaces` - Namespace: `AWS/AOSS` or Alias: `aoss` diff --git a/go.mod b/go.mod index 4614e9124d44..f8d9059376ab 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/PuerkitoBio/rehttp v1.1.0 github.com/alecthomas/kingpin/v2 v2.4.0 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 - github.com/aws/aws-sdk-go v1.45.24 + github.com/aws/aws-sdk-go v1.45.25 github.com/aws/aws-sdk-go-v2 v1.21.1 github.com/aws/aws-sdk-go-v2/config v1.18.44 github.com/aws/aws-sdk-go-v2/service/s3 v1.34.1 @@ -59,7 +59,7 @@ require ( github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a github.com/grafana/pyroscope-go/godeltaprof v0.1.3 github.com/grafana/pyroscope/api v0.2.0 - github.com/grafana/pyroscope/ebpf v0.4.0 + github.com/grafana/pyroscope/ebpf v0.4.1 github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db github.com/grafana/river v0.3.0 github.com/grafana/snowflake-prometheus-exporter v0.0.0-20221213150626-862cad8e9538 @@ -89,12 +89,12 @@ require ( github.com/klauspost/compress v1.17.3 github.com/lib/pq v1.10.7 github.com/mackerelio/go-osstat v0.2.3 - github.com/miekg/dns v1.1.55 + github.com/miekg/dns v1.1.56 github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 github.com/mitchellh/reflectwalk v1.0.2 github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f github.com/ncabatoff/process-exporter v0.7.10 - github.com/nerdswords/yet-another-cloudwatch-exporter v0.54.0 + github.com/nerdswords/yet-another-cloudwatch-exporter v0.55.0 github.com/ohler55/ojg v1.20.0 // indirect github.com/oklog/run v1.1.0 github.com/olekukonko/tablewriter v0.0.5 @@ -150,7 +150,7 @@ require ( github.com/prometheus/mysqld_exporter v0.14.0 github.com/prometheus/node_exporter v1.6.0 github.com/prometheus/procfs v0.12.0 - github.com/prometheus/prometheus v1.99.0 + github.com/prometheus/prometheus v0.48.1 github.com/prometheus/snmp_exporter v0.24.1 github.com/prometheus/statsd_exporter v0.22.8 github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052 @@ -219,7 +219,7 @@ require ( golang.org/x/sys v0.14.1-0.20231108175955-e4099bfacb8c golang.org/x/text v0.14.0 golang.org/x/time v0.3.0 - google.golang.org/api v0.146.0 + google.golang.org/api v0.147.0 google.golang.org/grpc v1.59.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 @@ -326,7 +326,7 @@ require ( github.com/dennwc/varint v1.0.0 // indirect github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/digitalocean/godo v1.99.0 // indirect + github.com/digitalocean/godo v1.104.1 // indirect github.com/dimchansky/utfbom v1.1.1 github.com/docker/cli v23.0.3+incompatible // indirect github.com/docker/distribution v2.8.2+incompatible // indirect @@ -391,11 +391,11 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect - github.com/gophercloud/gophercloud v1.5.0 // indirect + github.com/gophercloud/gophercloud v1.7.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gosnmp/gosnmp v1.36.0 // indirect github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9 // indirect - github.com/grafana/loki/pkg/push v0.0.0-20230904153656-e4cc2a4f5ec8 // k166 branch + github.com/grafana/loki/pkg/push v0.0.0-20231212100434-384e5c2dc872 // k180 branch github.com/grobie/gomemcache v0.0.0-20230213081705-239240bbc445 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect @@ -415,7 +415,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/mdns v1.0.4 // indirect github.com/hashicorp/memberlist v0.5.0 // indirect - github.com/hashicorp/nomad/api v0.0.0-20230718173136-3a687930bd3e // indirect + github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443 // indirect github.com/hodgesds/perf-utils v0.7.0 // indirect @@ -426,7 +426,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/infinityworks/go-common v0.0.0-20170820165359-7f20a140fd37 // indirect github.com/influxdata/telegraf v1.16.3 // indirect - github.com/ionos-cloud/sdk-go/v6 v6.1.8 // indirect + github.com/ionos-cloud/sdk-go/v6 v6.1.9 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgconn v1.13.0 // indirect github.com/jackc/pgio v1.0.0 // indirect @@ -456,7 +456,7 @@ require ( github.com/krallistic/kazoo-go v0.0.0-20170526135507-a15279744f4e // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 // indirect - github.com/linode/linodego v1.19.0 // indirect + github.com/linode/linodego v1.23.0 // indirect github.com/lufia/iostat v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -506,7 +506,7 @@ require ( github.com/opencontainers/selinux v1.11.0 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/oschwald/maxminddb-golang v1.11.0 - github.com/ovh/go-ovh v1.4.1 // indirect + github.com/ovh/go-ovh v1.4.3 // indirect github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect @@ -525,7 +525,7 @@ require ( github.com/safchain/ethtool v0.3.0 // indirect github.com/samber/lo v1.38.1 // indirect github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da // indirect - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 // indirect github.com/sergi/go-diff v1.2.0 // indirect @@ -590,7 +590,7 @@ require ( gonum.org/v1/gonum v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect @@ -613,21 +613,22 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.87.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.87.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver v0.87.0 - github.com/prometheus/tsdb v0.10.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 k8s.io/apimachinery v0.28.3 ) require ( dario.cat/mergo v1.0.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.2.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 // indirect github.com/Shopify/sarama v1.38.1 // indirect github.com/Workiva/go-datastructures v1.1.0 // indirect github.com/channelmeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61 // indirect github.com/drone/envsubst v1.0.3 // indirect - github.com/go-jose/go-jose/v3 v3.0.0 // indirect + github.com/go-jose/go-jose/v3 v3.0.1 // indirect github.com/golang-jwt/jwt/v5 v5.0.0 // indirect github.com/google/gnostic-models v0.6.8 // indirect - github.com/hetznercloud/hcloud-go/v2 v2.0.0 // indirect + github.com/hetznercloud/hcloud-go/v2 v2.4.0 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect github.com/knadh/koanf/v2 v2.0.1 // indirect github.com/lightstep/go-expohisto v1.0.0 // indirect @@ -676,14 +677,6 @@ replace ( k8s.io/klog/v2 => github.com/simonpasquier/klog-gokit/v3 v3.3.0 ) -// TODO(tpaschalis): remove replace directive once: -// -// * There is a release of Prometheus which contains -// prometheus/prometheus#12677 and prometheus/prometheus#12729. -// We use the last v1-related tag as the replace statement does not work for v2 -// tags without the v2 suffix to the module root. -replace github.com/prometheus/prometheus => github.com/grafana/prometheus v1.8.2-0.20231016083943-46550094220d // grafana:prometheus:v0.47.2-retry-improvements - replace gopkg.in/yaml.v2 => github.com/rfratto/go-yaml v0.0.0-20211119180816-77389c3526dc // Replace directives from Loki @@ -745,7 +738,3 @@ exclude ( ) replace github.com/github/smimesign => github.com/grafana/smimesign v0.2.1-0.20220408144937-2a5adf3481d3 - -// This is the last version that used slices.Func with a bool return -// If we upgrade to a newer one then since the signature changed loki will complain. -replace golang.org/x/exp => golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 diff --git a/go.sum b/go.sum index fed259a01614..d966bfea9876 100644 --- a/go.sum +++ b/go.sum @@ -64,6 +64,7 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxa contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= @@ -89,12 +90,18 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 h1:TuEMD+E+1aTjjLICGQOW6vLe8UWES7kopac9mUXL56Y= github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.2.1 h1:UPeCRD+XY7QlaGQte2EVI2iOcWvUYA2XY8w5T/8v0NQ= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4 v4.2.1/go.mod h1:oGV6NlB0cvi1ZbYRR2UN44QHxWFyGk+iylgD0qaMXjA= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0/go.mod h1:mLfWfj8v3jfWKsL9G4eoBoXVcsqcIUTapmdKy7uGOp0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor v0.10.2 h1:T3P5KJpcgN0m39dhaNM+JjSqF3Z5VqUlKHlth5FgN+8= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor v0.10.2/go.mod h1:yA8WUvh3K/SABQEtFHg2Bx5D+414FyFqpT5Fu58P3ao= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0/go.mod h1:243D9iHbcQXoFUtgHJwL7gl2zx1aDuDMjvBZVGr2uW0= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 h1:bWh0Z2rOEDfB/ywv/l0iHN1JgyazE6kW/aIA89+CEK0= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1/go.mod h1:Bzf34hhAE9NSxailk8xVeLEZbUjOXcC+GnU1mMKdhLw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.8.2 h1:f9lam+D19V0TDn17+aFhrVhWPpfsF5zaGHeqDGJZAVc= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.8.2/go.mod h1:29c9+gYpdWhyC4TPANZBPlgoWllMDhguL2AIByPYQtk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 h1:7CBQ+Ei8SP2c6ydQTGCCrS35bDxgTMfoP2miAwK++OU= @@ -171,6 +178,7 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0/go.mod h1:wP83 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0= github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -312,8 +320,8 @@ github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZve github.com/aws/aws-sdk-go v1.34.34/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.38.68/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.45.24 h1:TZx/CizkmCQn8Rtsb11iLYutEQVGK5PK9wAhwouELBo= -github.com/aws/aws-sdk-go v1.45.24/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= +github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.7.0/go.mod h1:tb9wi5s61kTDA5qCkcDbt3KRVV74GGslQkl/DRdX/P4= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= @@ -348,20 +356,20 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.3.44 h1:quOJOqlbSfeJTboXLjYXM1M9T52 github.com/aws/aws-sdk-go-v2/internal/ini v1.3.44/go.mod h1:LNy+P1+1LiRcCsVYr/4zG5n8zWFL0xsvZkOybjbftm8= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.26 h1:wscW+pnn3J1OYnanMnza5ZVYXLX4cKk5rAvUAl4Qu+c= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.26/go.mod h1:MtYiox5gvyB+OyP0Mr0Sm/yzbEAIPL9eijj/ouHAPw0= -github.com/aws/aws-sdk-go-v2/service/amp v1.16.14 h1:cak6jLkSwmPqcJ7pcVlkABsYfjCxxiyjBM2xBgjPwmY= -github.com/aws/aws-sdk-go-v2/service/amp v1.16.14/go.mod h1:Tq9wKXE+SPKKkwJSRHE/u+aOdUdvU//AuPfi/w6iNdc= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.14 h1:mXf/MQX2zcKpWTfI4YgHrD4UYBh6AzyBCRfVdsxExaU= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.16.14/go.mod h1:KJyzRVA5DkFaU4hVgKDoHiSrCobfmYP8UpRXlybTuTU= -github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.13.15 h1:lgTqmtilhObvVhxeBhX/KRC5RaB4A0dQqDDdLmfAP+0= -github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.13.15/go.mod h1:lg/1D90DDo2//C84mvygysHF4JRo+Vf/W5YbkHoeUk8= +github.com/aws/aws-sdk-go-v2/service/amp v1.17.5 h1:Wg2vTVYrMrfkNqrCGaggQq1UBdzgrAsorAfavLNpU/E= +github.com/aws/aws-sdk-go-v2/service/amp v1.17.5/go.mod h1:JXkUFaC1ISQYHO535+mgMPF0b1OaSdrsM5FhFfBbbQY= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.18.0 h1:rByriM7T0xvKy7eDiNUhFyVgnGupZ7DIifReKDzfk5E= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.18.0/go.mod h1:OJmEdRP/gDTqY71Cc/eJ/anpvvGHNgf62FyNuah3X48= +github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.14.5 h1:pLmOgMUiwXOi3oKx2J3feVb9JGVgwJ78RYnOV9UR0BM= +github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.14.5/go.mod h1:4eIs6K6ag6ymoUMOFfjm9dmP9KbuKgC7K5eIqlIBsbY= github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.28.10 h1:moHEk4wbdc8VNvff4UOLuXVHtjh7YtsGdiyB0MrPPKg= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.28.10/go.mod h1:P3qp1VYVoxHgDhpDDCTre1ee9IKpmgqnUoOb+8RA9qI= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.30.6 h1:OuxP8FzE3++AjQ8wabMcwJxtS25inpTIblMPNzV3nB8= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.30.6/go.mod h1:iHCpld+TvQd0odwp6BiwtL9H9LbU41kPW1i9oBy3iOo= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.5.0/go.mod h1:acH3+MQoiMzozT/ivU+DbRg7Ooo2298RdRaWcOv+4vM= -github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.27.0 h1:8ei9YIP3tmLbIX4rh1Hq9MM8/rpb1QBtHreVN/TP7wQ= -github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.27.0/go.mod h1:UXh7fjHrDoVd/tRPQyGCSfb04setwR75qxAx7+x1vcU= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.106.0 h1:chzRNw2kwcrosHm0k72Wyf4sbUNcG8+HeCJbSBtsOTk= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.106.0/go.mod h1:/0btVmMZJ0sn9JQ2N96XszlQNeRCJhhXOS/sPZgDeew= +github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.30.4 h1:Ir8BEejwSOOrD9juzFSMdXkXPyIdj1DfkFR+FJb0kc8= +github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.30.4/go.mod h1:NSAyKko0rDkrZOjcdCPPvMEe+FyIw/aDDQ8X+xAIW44= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 h1:Yq39vbwQX+Xw+Ubcsg/ElwO+TWAxAIAdrREtpjGnCHw= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 h1:y2+VQzC6Zh2ojtV2LoC0MNwHWc6qXv/j2vrQtlftkdA= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.29 h1:zZSLP3v3riMOP14H7b4XP0uyfREDQOYv2cqIrvTXDNQ= @@ -372,12 +380,12 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.36 h1:YXlm7LxwN github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.36/go.mod h1:ou9ffqJ9hKOVZmjlC6kQ6oROAyG1M4yBKzR+9BKbDwk= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.3 h1:dBL3StFxHtpBzJJ/mNEsjXVgfO+7jR0dAIEwLqMapEA= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.3/go.mod h1:f1QyiAsvIv4B49DmCqrhlXqyaR+0IxMmyX+1P+AnzOM= -github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.14.15 h1:5I9Yi2Ls1q8/VTpRmlLOGilFCtJNsEms+64BhYybm7Y= -github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.14.15/go.mod h1:86l8OObGPcaNgQ2pVaRRdaHTepispGs2UYLp8niWkSM= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.15.5 h1:dMsTYzhTpsDMY79IzCh/jq1tHRwgfa15ujhKUjZk0fg= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.15.5/go.mod h1:Lh/6ABs1m80bEB36fAW9gEPW5kSsAr7Mdn8dGyWRLp0= github.com/aws/aws-sdk-go-v2/service/s3 v1.34.1 h1:rYYwwsGqbwvGgQHjBkqgDt8MynXk+I8xgS0IEj5gOT0= github.com/aws/aws-sdk-go-v2/service/s3 v1.34.1/go.mod h1:aVbf0sko/TsLWHx30c/uVu7c62+0EAJ3vbxaJga0xCw= -github.com/aws/aws-sdk-go-v2/service/shield v1.18.13 h1:/QqZKWvxShuecy5hZm6P4pJQ2Uzn6TSJtsd9xeaqLG0= -github.com/aws/aws-sdk-go-v2/service/shield v1.18.13/go.mod h1:YcHL79qHynGYok2NKGb3+mrb6EWROWD4gBU3v+tKtUM= +github.com/aws/aws-sdk-go-v2/service/shield v1.19.5 h1:zX/1OHVjTNB2D1xiQ0pByYNLbVgbl84fTj5W4tMKdAk= +github.com/aws/aws-sdk-go-v2/service/shield v1.19.5/go.mod h1:NKqcE1DkD5YSbTAR8MxhFGFDmSkGNo68/Q8hht3Mi5w= github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sso v1.12.12/go.mod h1:HuCOxYsF21eKrerARYO6HapNeh9GBNq7fius2AcwodY= github.com/aws/aws-sdk-go-v2/service/sso v1.15.1 h1:ZN3bxw9OYC5D6umLw6f57rNJfGfhg1DIAAcKpzyUTOE= @@ -385,8 +393,8 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.15.1/go.mod h1:PieckvBoT5HtyB9AsJRrY github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12/go.mod h1:E4VrHCPzmVB/KFXtqBGKb3c8zpbNBgKe3fisDNLAW5w= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.2 h1:fSCCJuT5i6ht8TqGdZc5Q5K9pz/atrf7qH4iK5C9XzU= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.2/go.mod h1:5eNtr+vNc5vVd92q7SJ+U/HszsIdhZBEyi9dkMRKsp8= -github.com/aws/aws-sdk-go-v2/service/storagegateway v1.18.16 h1:Gk+75k6j55fqE+uA/99jAlcZBY4OLT244JuKp+HLXxo= -github.com/aws/aws-sdk-go-v2/service/storagegateway v1.18.16/go.mod h1:l/XhpyuxnJ3s8yKi9h0XDwVqM18iDEFeUVDYGCEcE/g= +github.com/aws/aws-sdk-go-v2/service/storagegateway v1.19.6 h1:DfxHxomSOVAmiYb4I1IkcrKtjFrm4EHUEw/oHPuNgxI= +github.com/aws/aws-sdk-go-v2/service/storagegateway v1.19.6/go.mod h1:o3x7HLasCY8mN914V4611sbXPOE54V8t0pzCtz5bxQ0= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/aws-sdk-go-v2/service/sts v1.19.2/go.mod h1:dp0yLPsLBOi++WTxzCjA/oZqi6NPIhoR+uF7GeMU9eg= github.com/aws/aws-sdk-go-v2/service/sts v1.23.1 h1:ASNYk1ypWAxRhJjKS0jBnTUeDl7HROOpeSMu1xDA/I8= @@ -559,12 +567,11 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.1.1/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= github.com/digitalocean/godo v1.7.5/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= github.com/digitalocean/godo v1.10.0/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= -github.com/digitalocean/godo v1.99.0 h1:gUHO7n9bDaZFWvbzOum4bXE0/09ZuYA9yA8idQHX57E= -github.com/digitalocean/godo v1.99.0/go.mod h1:SsS2oXo2rznfM/nORlZ/6JaUJZFhmKTib1YhopUc8NA= +github.com/digitalocean/godo v1.104.1 h1:SZNxjAsskM/su0YW9P8Wx3gU0W1Z13b6tZlYNpl5BnA= +github.com/digitalocean/godo v1.104.1/go.mod h1:VAI/L5YDzMuPRU01lEEUSQ/sp5Z//1HnnFv/RBTEdbg= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= @@ -715,9 +722,13 @@ github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2Su github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= +github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= +github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -1020,8 +1031,8 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/gopcua/opcua v0.1.12/go.mod h1:a6QH4F9XeODklCmWuvaOdL8v9H0d73CEKUHWVZLQyE8= github.com/gophercloud/gophercloud v0.0.0-20180828235145-f29afc2cceca/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v1.5.0 h1:cDN6XFCLKiiqvYpjQLq9AiM7RDRbIC9450WpPH+yvXo= -github.com/gophercloud/gophercloud v1.5.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.7.0 h1:fyJGKh0LBvIZKLvBWvQdIgkaV5yTM3Jh9EYUh+UNCAs= +github.com/gophercloud/gophercloud v1.7.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= @@ -1057,8 +1068,8 @@ github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9 h1:WB3bGH2f1UN6 github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU= github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a h1:lvSHlNONeo/H+aWRk86QEfBpRDCEX1yoqpsCK0Tys+g= github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a/go.mod h1:a5c5ZTC6FNufKkvF8NeDAb2nCWJpgkVDrejmV+O9hac= -github.com/grafana/loki/pkg/push v0.0.0-20230904153656-e4cc2a4f5ec8 h1:yQK/dX7WBva5QvITvmIcbv4boLwSo65a8zjuZcucnko= -github.com/grafana/loki/pkg/push v0.0.0-20230904153656-e4cc2a4f5ec8/go.mod h1:5ll3An1wAxYejo6aM04+3/lc6N4joYVYLY5U+Z4O6vI= +github.com/grafana/loki/pkg/push v0.0.0-20231212100434-384e5c2dc872 h1:6kPX7bngjBgUlHqADwZ6249UtzMaoQW5n0H8bOtnYeM= +github.com/grafana/loki/pkg/push v0.0.0-20231212100434-384e5c2dc872/go.mod h1:f3JSoxBTPXX5ec4FxxeC19nTBSxoTz+cBgS3cYLMcr0= github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595 h1:I9sRknI5ajd8whPOX0nBDXy5B6xUfhItClMy+6R4oqE= github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595/go.mod h1:U8ifHC5pT2WuVTO7ki4KZmWLjfEKfktQiU3bh0J8scw= github.com/grafana/node_exporter v0.18.1-grafana-r01.0.20231004161416-702318429731 h1:vyyIYY2sLpmgFIckJ1vSO/oYkvB0thDF6UiFYp5PThM= @@ -1069,14 +1080,12 @@ github.com/grafana/opentelemetry-collector/service v0.0.0-20231018134914-c0109e0 github.com/grafana/opentelemetry-collector/service v0.0.0-20231018134914-c0109e052230/go.mod h1:kBdpzrqR2wJkOdg50yzp4dv+2XBMyeqTgF4lCx0hSpQ= github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520 h1:HnFWqxhoSF3WC7sKAdMZ+SRXvHLVZlZ3sbQjuUlTqkw= github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520/go.mod h1:+HPXgiOV0InDHcZ2jNijL1SOKvo0eEPege5fQA0+ICI= -github.com/grafana/prometheus v1.8.2-0.20231016083943-46550094220d h1:hr0QEXSfpdakWdHw2sZeT/5GnGwIkHnNO0YBkfRj5zk= -github.com/grafana/prometheus v1.8.2-0.20231016083943-46550094220d/go.mod h1:J/bmOSjgH7lFxz2gZhrWEZs2i64vMS+HIuZfmYNhJ/M= github.com/grafana/pyroscope-go/godeltaprof v0.1.3 h1:eunWpv1B3Z7ZK9o4499EmQGlY+CsDmSZ4FbxjRx37uk= github.com/grafana/pyroscope-go/godeltaprof v0.1.3/go.mod h1:1HSPtjU8vLG0jE9JrTdzjgFqdJ/VgN7fvxBNq3luJko= github.com/grafana/pyroscope/api v0.2.0 h1:TzOxL0s6SiaLEy944ZAKgHcx/JDRJXu4O8ObwkqR6p4= github.com/grafana/pyroscope/api v0.2.0/go.mod h1:nhH+xai9cYFgs6lMy/+L0pKj0d5yCMwji/QAiQFCP+U= -github.com/grafana/pyroscope/ebpf v0.4.0 h1:7fz+5S6MLSc+5cJfmIe7OCvBdooxEm8xy5OAV0s7GA0= -github.com/grafana/pyroscope/ebpf v0.4.0/go.mod h1:eF5+k9lAUBYILVzGccr3hrrvuLy5ZvbDRWGQHDe021w= +github.com/grafana/pyroscope/ebpf v0.4.1 h1:iqQoOsfKen5KpTRe6MfGeBZfgK1s7ROH+Cs/vZs1B3A= +github.com/grafana/pyroscope/ebpf v0.4.1/go.mod h1:W99Mq+yJGP5nZUQWNv+jVytiWWgWXwHjIRmi9k3xHzA= github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzedH7MZzRZt5/lsAHch6Z3L2ZGn5FA= github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/grafana/river v0.3.0 h1:6TsaR/vkkcppUM9I0muGbPIUedCtpPu6OWreE5+CE6g= @@ -1224,8 +1233,8 @@ github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOn github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69/go.mod h1:/z+jUGRBlwVpUZfjute9jWaF6/HuhjuFQuL1YXzVD1Q= -github.com/hashicorp/nomad/api v0.0.0-20230718173136-3a687930bd3e h1:sr4lujmn9heD030xx/Pd4B/JSmvRhFzuotNXaaV0WLs= -github.com/hashicorp/nomad/api v0.0.0-20230718173136-3a687930bd3e/go.mod h1:O23qLAZuCx4htdY9zBaO4cJPXgleSFEdq6D/sezGgYE= +github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c h1:Nc3Mt2BAnq0/VoLEntF/nipX+K1S7pG+RgwiitSv6v0= +github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c/go.mod h1:O23qLAZuCx4htdY9zBaO4cJPXgleSFEdq6D/sezGgYE= github.com/hashicorp/raft v1.0.1-0.20190409200437-d9fe23f7d472/go.mod h1:DVSAWItjLjTOkVbSpWQ0j0kUADIvDaCtBxIcbNAQLkI= github.com/hashicorp/raft-boltdb v0.0.0-20150201200839-d1e82c1ec3f1/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= github.com/hashicorp/serf v0.8.1/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= @@ -1262,8 +1271,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/heroku/x v0.0.61 h1:yfoAAtnFWSFZj+UlS+RZL/h8QYEp1R4wHVEg0G+Hwh4= github.com/heroku/x v0.0.61/go.mod h1:C7xYbpMdond+s6L5VpniDUSVPRwm3kZum1o7XiD5ZHk= -github.com/hetznercloud/hcloud-go/v2 v2.0.0 h1:Sg1DJ+MAKvbYAqaBaq9tPbwXBS2ckPIaMtVdUjKu+4g= -github.com/hetznercloud/hcloud-go/v2 v2.0.0/go.mod h1:4iUG2NG8b61IAwNx6UsMWQ6IfIf/i1RsG0BbsKAyR5Q= +github.com/hetznercloud/hcloud-go/v2 v2.4.0 h1:MqlAE+w125PLvJRCpAJmEwrIxoVdUdOyuFUhE/Ukbok= +github.com/hetznercloud/hcloud-go/v2 v2.4.0/go.mod h1:l7fA5xsncFBzQTyw29/dw5Yr88yEGKKdc6BHf24ONS0= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= @@ -1305,8 +1314,8 @@ github.com/influxdata/telegraf v1.16.3 h1:x0qeuSGGMg5y+YqP/5ZHwXZu3bcBrO8AAQOTNl github.com/influxdata/telegraf v1.16.3/go.mod h1:fX/6k7qpIqzVPWyeIamb0wN5hbwc0ANUaTS80lPYFB8= github.com/influxdata/toml v0.0.0-20190415235208-270119a8ce65/go.mod h1:zApaNFpP/bTpQItGZNNUMISDMDAnTXu9UqJ4yT3ocz8= github.com/influxdata/wlog v0.0.0-20160411224016-7c63b0a71ef8/go.mod h1:/2NMgWB1DHM1ti/gqhOlg+LJeBVk6FqR5aVGYY0hlwI= -github.com/ionos-cloud/sdk-go/v6 v6.1.8 h1:493wE/BkZxJf7x79UCE0cYGPZoqQcPiEBALvt7uVGY0= -github.com/ionos-cloud/sdk-go/v6 v6.1.8/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= +github.com/ionos-cloud/sdk-go/v6 v6.1.9 h1:Iq3VIXzeEbc8EbButuACgfLMiY5TPVWUPNrF+Vsddo4= +github.com/ionos-cloud/sdk-go/v6 v6.1.9/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -1495,8 +1504,8 @@ github.com/lightstep/go-expohisto v1.0.0/go.mod h1:xDXD0++Mu2FOaItXtdDfksfgxfV0z github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linode/linodego v0.7.1/go.mod h1:ga11n3ivecUrPCHN0rANxKmfWBJVkOXfLMZinAbj2sY= -github.com/linode/linodego v1.19.0 h1:n4WJrcr9+30e9JGZ6DI0nZbm5SdAj1kSwvvt/998YUw= -github.com/linode/linodego v1.19.0/go.mod h1:XZFR+yJ9mm2kwf6itZ6SCpu+6w3KnIevV0Uu5HNWJgQ= +github.com/linode/linodego v1.23.0 h1:s0ReCZtuN9Z1IoUN9w1RLeYO1dMZUGPwOQ/IBFsBHtU= +github.com/linode/linodego v1.23.0/go.mod h1:0U7wj/UQOqBNbKv1FYTXiBUXueR8DY4HvIotwE0ENgg= github.com/lufia/iostat v1.2.1 h1:tnCdZBIglgxD47RyD55kfWQcJMGzO+1QBziSQfesf2k= github.com/lufia/iostat v1.2.1/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= @@ -1577,8 +1586,8 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= -github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE= +github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= @@ -1681,8 +1690,8 @@ github.com/ncabatoff/go-seq v0.0.0-20180805175032-b08ef85ed833 h1:t4WWQ9I797y7QU github.com/ncabatoff/go-seq v0.0.0-20180805175032-b08ef85ed833/go.mod h1:0CznHmXSjMEqs5Tezj/w2emQoM41wzYM9KpDKUHPYag= github.com/ncabatoff/process-exporter v0.7.10 h1:+Ere7+3se6QqP54gg7aBRagWcL8bq3u5zNi/GRSWeKQ= github.com/ncabatoff/process-exporter v0.7.10/go.mod h1:DHZRZjqxw9LCOpLlX0DjBuyn6d5plh41Jv6Tmttj7Ek= -github.com/nerdswords/yet-another-cloudwatch-exporter v0.54.0 h1:a2jReAfDiSyU/aXCKO05hcJMTdtyQQyj41Jmwyg6fh8= -github.com/nerdswords/yet-another-cloudwatch-exporter v0.54.0/go.mod h1:VngmqrhYKwZzUuv/sgVCfUhLB6BkgSZfL5USqZbGKnY= +github.com/nerdswords/yet-another-cloudwatch-exporter v0.55.0 h1:M3fH9gzU48jBfYbXXYEZVTcUhnfhDIG/oeIQl6kBGP0= +github.com/nerdswords/yet-another-cloudwatch-exporter v0.55.0/go.mod h1:GR4pDHlRonT97AsGSmlcWiISF8AjifK/19SAVD0tIlU= github.com/newrelic/newrelic-telemetry-sdk-go v0.2.0/go.mod h1:G9MqE/cHGv3Hx3qpYhfuyFUsGx2DpVcGi1iJIqTg+JQ= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 h1:BQ1HW7hr4IVovMwWg0E0PYcyW8CzqDcVmaew9cujU4s= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2/go.mod h1:TLb2Sg7HQcgGdloNxkrmtgDNR9uVYF3lfdFIN4Ro6Sk= @@ -1861,8 +1870,8 @@ github.com/oschwald/geoip2-golang v1.9.0 h1:uvD3O6fXAXs+usU+UGExshpdP13GAqp4GBrz github.com/oschwald/geoip2-golang v1.9.0/go.mod h1:BHK6TvDyATVQhKNbQBdrj9eAvuwOMi2zSFXizL3K81Y= github.com/oschwald/maxminddb-golang v1.11.0 h1:aSXMqYR/EPNjGE8epgqwDay+P30hCBZIveY0WZbAWh0= github.com/oschwald/maxminddb-golang v1.11.0/go.mod h1:YmVI+H0zh3ySFR3w+oz8PCfglAFj3PuCmui13+P9zDg= -github.com/ovh/go-ovh v1.4.1 h1:VBGa5wMyQtTP7Zb+w97zRCh9sLtM/2YKRyy+MEJmWaM= -github.com/ovh/go-ovh v1.4.1/go.mod h1:6bL6pPyUT7tBfI0pqOegJgRjgjuO+mOo+MyXd1EEC0M= +github.com/ovh/go-ovh v1.4.3 h1:Gs3V823zwTFpzgGLZNI6ILS4rmxZgJwJCz54Er9LwD0= +github.com/ovh/go-ovh v1.4.3/go.mod h1:AkPXVtgwB6xlKblMjRKJJmjRp+ogrE7fz2lVgcQY8SY= github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c h1:vwpFWvAO8DeIZfFeqASzZfsxuWPno9ncAebBEP0N3uE= github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c/go.mod h1:otzZQXgoO96RTzDB/Hycg0qZcXZsWJGJRSXbmEIJ+4M= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -2001,13 +2010,13 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/prometheus v0.48.1 h1:CTszphSNTXkuCG6O0IfpKdHcJkvvnAAE1GbELKS+NFk= +github.com/prometheus/prometheus v0.48.1/go.mod h1:SRw624aMAxTfryAcP8rOjg4S/sHHaetx2lyJJ2nM83g= github.com/prometheus/snmp_exporter v0.24.1 h1:AihTbJHurMo8bjtjJde8U+4gMEvpvYvT21Xbd4SzJgY= github.com/prometheus/snmp_exporter v0.24.1/go.mod h1:j6uIGkdR0DXvKn7HJtSkeDj//UY0sWmdd6XhvdBjln0= github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= github.com/prometheus/statsd_exporter v0.22.8 h1:Qo2D9ZzaQG+id9i5NYNGmbf1aa/KxKbB9aKfMS+Yib0= github.com/prometheus/statsd_exporter v0.22.8/go.mod h1:/DzwbTEaFTE0Ojz5PqcSk6+PFHOPWGxdXVr6yC8eFOM= -github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= -github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= @@ -2056,8 +2065,8 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCL github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20 h1:a9hSJdJcd16e0HoMsnFvaHvxB3pxSD+SC7+CISp7xY0= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21 h1:yWfiTPwYxB0l5fGMhl/G+liULugVIHD9AU77iNLrURQ= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= @@ -2504,15 +2513,29 @@ golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +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-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +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-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -2526,8 +2549,12 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -2535,9 +2562,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2687,6 +2712,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191003212358-c178f38b412c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2830,6 +2856,7 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2845,9 +2872,11 @@ golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -2863,6 +2892,7 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2894,7 +2924,6 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= @@ -2946,8 +2975,8 @@ google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00 google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.146.0 h1:9aBYT4vQXt9dhCuLNfwfd3zpwu8atg0yPkjBymwSrOM= -google.golang.org/api v0.146.0/go.mod h1:OARJqIfoYjXJj4C1AiBSXYZt03qsoz8FQYU6fBEfrHM= +google.golang.org/api v0.147.0 h1:Can3FaQo9LlVqxJCodNmeZW/ib3/qKAY3rFeXiHo5gc= +google.golang.org/api v0.147.0/go.mod h1:pQ/9j83DcmPd/5C9e2nFOdjjNkDZ1G+zkbK2uvdkJMs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -3023,8 +3052,8 @@ google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a h1:myvhA4is3vrit1a6NZCWBIwN0kNEnX21DJOJX/NvIfI= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/grpc v0.0.0-20180920234847-8997b5fa0873/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= diff --git a/pkg/metrics/instance/configstore/api_test.go b/pkg/metrics/instance/configstore/api_test.go index 15a111520301..84c0198dee00 100644 --- a/pkg/metrics/instance/configstore/api_test.go +++ b/pkg/metrics/instance/configstore/api_test.go @@ -139,6 +139,7 @@ scrape_configs: honor_timestamps: true metrics_path: /metrics scheme: http + track_timestamps_staleness: true static_configs: - targets: - 127.0.0.1:12345 diff --git a/pkg/metrics/instance/host_filter_test.go b/pkg/metrics/instance/host_filter_test.go index aa53bd25b727..8a24373594c0 100644 --- a/pkg/metrics/instance/host_filter_test.go +++ b/pkg/metrics/instance/host_filter_test.go @@ -172,6 +172,7 @@ func TestHostFilter_PatchSD(t *testing.T) { honor_timestamps: true metrics_path: /metrics scheme: http + track_timestamps_staleness: false follow_redirects: true enable_http2: true kubernetes_sd_configs: diff --git a/pkg/metrics/instance/marshal_test.go b/pkg/metrics/instance/marshal_test.go index 5d2a68b870da..b102c3d635d2 100644 --- a/pkg/metrics/instance/marshal_test.go +++ b/pkg/metrics/instance/marshal_test.go @@ -36,6 +36,7 @@ scrape_configs: honor_timestamps: true metrics_path: /metrics scheme: http + track_timestamps_staleness: true static_configs: - targets: - 127.0.0.1:12345 @@ -92,6 +93,7 @@ scrape_configs: honor_timestamps: true metrics_path: /metrics scheme: http + track_timestamps_staleness: true static_configs: - targets: - 127.0.0.1:12345 From d8efe1a9412b8997d24a075c7ffecbd6157c9bf6 Mon Sep 17 00:00:00 2001 From: Piotr <17101802+thampiotr@users.noreply.github.com> Date: Fri, 5 Jan 2024 14:33:14 +0100 Subject: [PATCH 15/19] create migrate tasks subdirectory (#6051) --- docs/sources/about.md | 4 ++-- docs/sources/flow/reference/cli/convert.md | 6 +++--- docs/sources/flow/tasks/migrate/_index.md | 19 +++++++++++++++++++ .../from-operator.md} | 12 ++++++------ .../from-prometheus.md} | 10 +++++----- .../from-promtail.md} | 10 +++++----- .../from-static.md} | 18 +++++++++--------- 7 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 docs/sources/flow/tasks/migrate/_index.md rename docs/sources/flow/tasks/{migrating-from-operator.md => migrate/from-operator.md} (97%) rename docs/sources/flow/tasks/{migrating-from-prometheus.md => migrate/from-prometheus.md} (98%) rename docs/sources/flow/tasks/{migrating-from-promtail.md => migrate/from-promtail.md} (98%) rename docs/sources/flow/tasks/{migrating-from-static.md => migrate/from-static.md} (97%) diff --git a/docs/sources/about.md b/docs/sources/about.md index c33d73087408..57468c7f3e24 100644 --- a/docs/sources/about.md +++ b/docs/sources/about.md @@ -33,8 +33,8 @@ Grafana Agent is available in three different variants: [Prometheus]: "/docs/grafana-cloud/ -> /docs/agent//flow/tasks/collect-prometheus-metrics.md" [OTel]: "/docs/agent/ -> /docs/agent//flow/tasks/collect-opentelemetry-data.md" [OTel]: "/docs/grafana-cloud/ -> /docs/agent//flow/tasks/collect-opentelemetry-data.md" -[Loki]: "/docs/agent/ -> /docs/agent//flow/tasks/migrating-from-promtail.md" -[Loki]: "/docs/grafana-cloud/ -> /docs/agent//flow/tasks/migrating-from-promtail.md" +[Loki]: "/docs/agent/ -> /docs/agent//flow/tasks/migrate/from-promtail.md" +[Loki]: "/docs/grafana-cloud/ -> /docs/agent//flow/tasks/migrate/from-promtail.md" [clustering]: "/docs/agent/ -> /docs/agent//flow/concepts/clustering/_index.md" [clustering]: "/docs/grafana-cloud/ -> /docs/agent//flow/concepts/clustering/_index.md" [rules]: "/docs/agent/ -> /docs/agent/latest/flow/reference/components/mimir.rules.kubernetes.md" diff --git a/docs/sources/flow/reference/cli/convert.md b/docs/sources/flow/reference/cli/convert.md index 833341b47752..a9a3810ec3ee 100644 --- a/docs/sources/flow/reference/cli/convert.md +++ b/docs/sources/flow/reference/cli/convert.md @@ -82,7 +82,7 @@ This includes Prometheus features such as and many supported *_sd_configs. Unsupported features in a source configuration result in [errors]. -Refer to [Migrate from Prometheus to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrating-from-prometheus/" >}}) for a detailed migration guide. +Refer to [Migrate from Prometheus to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrate/from-prometheus/" >}}) for a detailed migration guide. ### Promtail @@ -96,7 +96,7 @@ are supported and can be converted to {{< param "PRODUCT_NAME" >}} configuration If you have unsupported features in a source configuration, you will receive [errors] when you convert to a flow configuration. The converter will also raise warnings for configuration options that may require your attention. -Refer to [Migrate from Promtail to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrating-from-promtail/" >}}) for a detailed migration guide. +Refer to [Migrate from Promtail to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrate/from-promtail/" >}}) for a detailed migration guide. ### Static @@ -113,4 +113,4 @@ flags with a space between each flag, for example `--extra-args="-enable-feature If you have unsupported features in a Static mode source configuration, you will receive [errors][] when you convert to a Flow mode configuration. The converter will also raise warnings for configuration options that may require your attention. -Refer to [Migrate from Grafana Agent Static to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrating-from-static/" >}}) for a detailed migration guide. \ No newline at end of file +Refer to [Migrate from Grafana Agent Static to {{< param "PRODUCT_NAME" >}}]({{< relref "../../tasks/migrate/from-static/" >}}) for a detailed migration guide. \ No newline at end of file diff --git a/docs/sources/flow/tasks/migrate/_index.md b/docs/sources/flow/tasks/migrate/_index.md new file mode 100644 index 000000000000..a0c98966dcb4 --- /dev/null +++ b/docs/sources/flow/tasks/migrate/_index.md @@ -0,0 +1,19 @@ +--- +aliases: +- /docs/grafana-cloud/agent/flow/tasks/migrate/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrate/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrate/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrate/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrate/ +description: How to migrate to Grafana Agent Flow +menuTitle: Migrate +title: Migrate to Grafana Agent Flow +weight: 100 +--- + +# How to migrate to {{% param "PRODUCT_NAME" %}} + +This section details how to migrate to {{< param "PRODUCT_NAME" >}} from other +common solutions. + +{{< section >}} diff --git a/docs/sources/flow/tasks/migrating-from-operator.md b/docs/sources/flow/tasks/migrate/from-operator.md similarity index 97% rename from docs/sources/flow/tasks/migrating-from-operator.md rename to docs/sources/flow/tasks/migrate/from-operator.md index 375ffec59e51..1e942a2da941 100644 --- a/docs/sources/flow/tasks/migrating-from-operator.md +++ b/docs/sources/flow/tasks/migrate/from-operator.md @@ -1,19 +1,19 @@ --- aliases: -- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-operator/ -- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-operator/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrate/from-operator/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrate/from-operator/ # Previous page aliases for backwards compatibility: - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-operator/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-operator/ - ../getting-started/migrating-from-operator/ # /docs/agent/latest/flow/getting-started/migrating-from-operator/ -canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-operator/ -description: Migrating from Grafana Agent Operator to Grafana Agent Flow +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrate/from-operator/ +description: Migrate from Grafana Agent Operator to Grafana Agent Flow menuTitle: Migrate from Operator -title: Migrating from Grafana Agent Operator to Grafana Agent Flow +title: Migrate from Grafana Agent Operator to Grafana Agent Flow weight: 320 --- -# Migrating from Grafana Agent Operator to {{% param "PRODUCT_NAME" %}} +# Migrate from Grafana Agent Operator to {{% param "PRODUCT_NAME" %}} With the release of {{< param "PRODUCT_NAME" >}}, Grafana Agent Operator is no longer the recommended way to deploy {{< param "PRODUCT_ROOT_NAME" >}} in Kubernetes. Some of the Operator functionality has moved into {{< param "PRODUCT_NAME" >}} itself, and the Helm Chart has replaced the remaining functionality. diff --git a/docs/sources/flow/tasks/migrating-from-prometheus.md b/docs/sources/flow/tasks/migrate/from-prometheus.md similarity index 98% rename from docs/sources/flow/tasks/migrating-from-prometheus.md rename to docs/sources/flow/tasks/migrate/from-prometheus.md index 837ca9da1e07..74a53f2475c5 100644 --- a/docs/sources/flow/tasks/migrating-from-prometheus.md +++ b/docs/sources/flow/tasks/migrate/from-prometheus.md @@ -1,16 +1,16 @@ --- aliases: -- /docs/grafana-cloud/agent/flow/tasks/migrating-from-prometheus/ -- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-prometheus/ -- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrating-from-prometheus/ -- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-prometheus/ +- /docs/grafana-cloud/agent/flow/tasks/migrate/from-prometheus/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrate/from-prometheus/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrate/from-prometheus/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrate/from-prometheus/ # Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/migrating-from-prometheus/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-prometheus/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/migrating-from-prometheus/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-prometheus/ - ../getting-started/migrating-from-prometheus/ # /docs/agent/latest/flow/getting-started/migrating-from-prometheus/ -canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-prometheus/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrate/from-prometheus/ description: Learn how to migrate from Prometheus to Grafana Agent Flow menuTitle: Migrate from Prometheus title: Migrate from Prometheus to Grafana Agent Flow diff --git a/docs/sources/flow/tasks/migrating-from-promtail.md b/docs/sources/flow/tasks/migrate/from-promtail.md similarity index 98% rename from docs/sources/flow/tasks/migrating-from-promtail.md rename to docs/sources/flow/tasks/migrate/from-promtail.md index d38e9b904697..89c863f8758f 100644 --- a/docs/sources/flow/tasks/migrating-from-promtail.md +++ b/docs/sources/flow/tasks/migrate/from-promtail.md @@ -1,16 +1,16 @@ --- aliases: -- /docs/grafana-cloud/agent/flow/tasks/migrating-from-promtail/ -- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-promtail/ -- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrating-from-promtail/ -- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-promtail/ +- /docs/grafana-cloud/agent/flow/tasks/migrate/from-promtail/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrate/from-promtail/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrate/from-promtail/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrate/from-promtail/ # Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/migrating-from-promtail/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-promtail/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/migrating-from-promtail/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-promtail/ - ../getting-started/migrating-from-promtail/ # /docs/agent/latest/flow/getting-started/migrating-from-promtail/ -canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-promtail/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrate/from-promtail/ description: Learn how to migrate from Promtail to Grafana Agent Flow menuTitle: Migrate from Promtail title: Migrate from Promtail to Grafana Agent Flow diff --git a/docs/sources/flow/tasks/migrating-from-static.md b/docs/sources/flow/tasks/migrate/from-static.md similarity index 97% rename from docs/sources/flow/tasks/migrating-from-static.md rename to docs/sources/flow/tasks/migrate/from-static.md index a4033dab096a..bf8532f207d9 100644 --- a/docs/sources/flow/tasks/migrating-from-static.md +++ b/docs/sources/flow/tasks/migrate/from-static.md @@ -1,16 +1,16 @@ --- aliases: -- /docs/grafana-cloud/agent/flow/tasks/migrating-from-static/ -- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrating-from-static/ -- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrating-from-static/ -- /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-static/ +- /docs/grafana-cloud/agent/flow/tasks/migrate/from-static/ +- /docs/grafana-cloud/monitor-infrastructure/agent/flow/tasks/migrate/from-static/ +- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tasks/migrate/from-static/ +- /docs/grafana-cloud/send-data/agent/flow/tasks/migrate/from-static/ # Previous page aliases for backwards compatibility: - /docs/grafana-cloud/agent/flow/getting-started/migrating-from-static/ - /docs/grafana-cloud/monitor-infrastructure/agent/flow/getting-started/migrating-from-static/ - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/getting-started/migrating-from-static/ - /docs/grafana-cloud/send-data/agent/flow/getting-started/migrating-from-static/ - ../getting-started/migrating-from-static/ # /docs/agent/latest/flow/getting-started/migrating-from-static/ -canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrating-from-static/ +canonical: https://grafana.com/docs/agent/latest/flow/tasks/migrate/from-static/ description: Learn how to migrate your configuration from Grafana Agent Static to Grafana Agent Flow menuTitle: Migrate from Static to Flow title: Migrate Grafana Agent Static to Grafana Agent Flow @@ -388,10 +388,10 @@ The following list is specific to the convert command and not {{< param "PRODUCT [Agent Management]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/static/configuration/agent-management.md" [env]: "/docs/agent/ -> /docs/agent//flow/reference/stdlib/env.md" [env]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/reference/stdlib/env.md" -[Prometheus Limitations]: "/docs/agent/ -> /docs/agent//flow/tasks/migrating-from-prometheus.md#limitations" -[Prometheus Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-prometheus.md#limitations" -[Promtail Limitations]: "/docs/agent/ -> /docs/agent//flow/tasks/migrating-from-promtail.md#limitations" -[Promtail Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/migrating-from-promtail.md#limitations" +[Prometheus Limitations]: "/docs/agent/ -> /docs/agent//flow/tasks/migrate/from-prometheus.md#limitations" +[Prometheus Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/migrate/from-prometheus.md#limitations" +[Promtail Limitations]: "/docs/agent/ -> /docs/agent//flow/tasks/migrate/from-promtail.md#limitations" +[Promtail Limitations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/migrate/from-promtail.md#limitations" [Metrics]: "/docs/agent/ -> /docs/agent//static/configuration/metrics-config.md" [Metrics]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/static/configuration/metrics-config.md" [Logs]: "/docs/agent/ -> /docs/agent//static/configuration/logs-config.md" From 0b25b5fdca2526ca4d4341c5484a55085f155ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Tudur=C3=AD?= Date: Fri, 5 Jan 2024 15:40:28 +0100 Subject: [PATCH 16/19] Add `sample_age_limit` to remote_write config to drop old samples (#6052) --- CHANGELOG.md | 1 + component/prometheus/remotewrite/types.go | 3 +++ .../prometheusconvert/component/remote_write.go | 1 + .../testdata-v2/integrations_v2.river | 2 +- .../staticconvert/testdata-v2/unsupported.river | 2 +- .../testdata/prom_remote_write.river | 16 ++++++++-------- .../staticconvert/testdata/prom_scrape.river | 3 ++- .../staticconvert/testdata/prom_scrape.yaml | 1 + .../staticconvert/testdata/promtail_prom.river | 2 +- .../staticconvert/testdata/sanitize.river | 2 +- .../staticconvert/testdata/unsupported.river | 4 ++-- .../components/prometheus.remote_write.md | 5 +++++ go.mod | 12 ++++++++++-- go.sum | 12 ++++++------ 14 files changed, 43 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d008e4ab023..47d9a28c0716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ Main (unreleased) - Add support for `http_sd_config` within a `scrape_config` for prometheus to flow config conversion. (@erikbaranowski) - `discovery.lightsail` now supports additional parameters for configuring HTTP client settings. (@ptodev) +- Add `sample_age_limit` to remote_write config to drop samples older than a specified duration. (@marctc) ### Bugfixes diff --git a/component/prometheus/remotewrite/types.go b/component/prometheus/remotewrite/types.go index 473a2928e246..637059aba416 100644 --- a/component/prometheus/remotewrite/types.go +++ b/component/prometheus/remotewrite/types.go @@ -35,6 +35,7 @@ var ( MinBackoff: 30 * time.Millisecond, MaxBackoff: 5 * time.Second, RetryOnHTTP429: true, + SampleAgeLimit: 0, } DefaultMetadataOptions = MetadataOptions{ @@ -141,6 +142,7 @@ type QueueOptions struct { MinBackoff time.Duration `river:"min_backoff,attr,optional"` MaxBackoff time.Duration `river:"max_backoff,attr,optional"` RetryOnHTTP429 bool `river:"retry_on_http_429,attr,optional"` + SampleAgeLimit time.Duration `river:"sample_age_limit,attr,optional"` } // SetToDefault implements river.Defaulter. @@ -164,6 +166,7 @@ func (r *QueueOptions) toPrometheusType() config.QueueConfig { MinBackoff: model.Duration(r.MinBackoff), MaxBackoff: model.Duration(r.MaxBackoff), RetryOnRateLimit: r.RetryOnHTTP429, + SampleAgeLimit: model.Duration(r.SampleAgeLimit), } } diff --git a/converter/internal/prometheusconvert/component/remote_write.go b/converter/internal/prometheusconvert/component/remote_write.go index 4756f84d6674..37c4c6814a04 100644 --- a/converter/internal/prometheusconvert/component/remote_write.go +++ b/converter/internal/prometheusconvert/component/remote_write.go @@ -96,6 +96,7 @@ func toQueueOptions(queueConfig *prom_config.QueueConfig) *remotewrite.QueueOpti MinBackoff: time.Duration(queueConfig.MinBackoff), MaxBackoff: time.Duration(queueConfig.MaxBackoff), RetryOnHTTP429: queueConfig.RetryOnRateLimit, + SampleAgeLimit: time.Duration(queueConfig.SampleAgeLimit), } } diff --git a/converter/internal/staticconvert/testdata-v2/integrations_v2.river b/converter/internal/staticconvert/testdata-v2/integrations_v2.river index d6306565d9e2..919af1b47286 100644 --- a/converter/internal/staticconvert/testdata-v2/integrations_v2.river +++ b/converter/internal/staticconvert/testdata-v2/integrations_v2.river @@ -1,6 +1,6 @@ prometheus.remote_write "metrics_default" { endpoint { - name = "default-8be96f" + name = "default-149bbd" url = "http://localhost:9009/api/prom/push" queue_config { } diff --git a/converter/internal/staticconvert/testdata-v2/unsupported.river b/converter/internal/staticconvert/testdata-v2/unsupported.river index 0dcdb9ac79a6..c9585a88c5dc 100644 --- a/converter/internal/staticconvert/testdata-v2/unsupported.river +++ b/converter/internal/staticconvert/testdata-v2/unsupported.river @@ -1,6 +1,6 @@ prometheus.remote_write "metrics_default" { endpoint { - name = "default-8be96f" + name = "default-149bbd" url = "http://localhost:9009/api/prom/push" queue_config { } diff --git a/converter/internal/staticconvert/testdata/prom_remote_write.river b/converter/internal/staticconvert/testdata/prom_remote_write.river index bc9edcd50834..2d341fed6a5b 100644 --- a/converter/internal/staticconvert/testdata/prom_remote_write.river +++ b/converter/internal/staticconvert/testdata/prom_remote_write.river @@ -1,6 +1,6 @@ prometheus.remote_write "metrics_test1" { endpoint { - name = "test1-8be96f" + name = "test1-149bbd" url = "http://localhost:9009/api/prom/push" queue_config { } @@ -11,7 +11,7 @@ prometheus.remote_write "metrics_test1" { prometheus.remote_write "metrics_test2" { endpoint { - name = "test2-533083" + name = "test2-c6d55a" url = "http://localhost:9010/api/prom/push" send_exemplars = false @@ -23,7 +23,7 @@ prometheus.remote_write "metrics_test2" { prometheus.remote_write "metrics_test3" { endpoint { - name = "test3-a3c419" + name = "test3-aa96fd" url = "http://localhost:9011/api/prom/push" queue_config { } @@ -32,7 +32,7 @@ prometheus.remote_write "metrics_test3" { } endpoint { - name = "test3-41df1c" + name = "test3-a93240" url = "http://localhost:9012/api/prom/push" queue_config { @@ -45,7 +45,7 @@ prometheus.remote_write "metrics_test3" { prometheus.remote_write "metrics_test4_sigv4_defaults" { endpoint { - name = "test4_sigv4_defaults-c42e88" + name = "test4_sigv4_defaults-f815bf" url = "http://localhost:9012/api/prom/push" queue_config { } @@ -58,7 +58,7 @@ prometheus.remote_write "metrics_test4_sigv4_defaults" { prometheus.remote_write "metrics_test5_sigv4_explicit" { endpoint { - name = "test5_sigv4_explicit-050ad5" + name = "test5_sigv4_explicit-bc8fca" url = "http://localhost:9012/api/prom/push" queue_config { } @@ -77,7 +77,7 @@ prometheus.remote_write "metrics_test5_sigv4_explicit" { prometheus.remote_write "metrics_test6_azuread_defaults" { endpoint { - name = "test6_azuread_defaults-fbed02" + name = "test6_azuread_defaults-cc4e7e" url = "http://localhost:9012/api/prom/push" queue_config { } @@ -94,7 +94,7 @@ prometheus.remote_write "metrics_test6_azuread_defaults" { prometheus.remote_write "metrics_test7_azuread_explicit" { endpoint { - name = "test7_azuread_explicit-416842" + name = "test7_azuread_explicit-9e1a3e" url = "http://localhost:9012/api/prom/push" queue_config { } diff --git a/converter/internal/staticconvert/testdata/prom_scrape.river b/converter/internal/staticconvert/testdata/prom_scrape.river index e73fd76733e3..f0afe395531e 100644 --- a/converter/internal/staticconvert/testdata/prom_scrape.river +++ b/converter/internal/staticconvert/testdata/prom_scrape.river @@ -91,7 +91,7 @@ prometheus.relabel "metrics_agent_promobee" { prometheus.remote_write "metrics_agent" { endpoint { - name = "agent-6ea089" + name = "agent-36127e" url = "https://prometheus-us-central1.grafana.net/api/prom/push" basic_auth { @@ -103,6 +103,7 @@ prometheus.remote_write "metrics_agent" { max_shards = 10 batch_send_deadline = "3m0s" max_backoff = "10s" + sample_age_limit = "50s" } metadata_config { } diff --git a/converter/internal/staticconvert/testdata/prom_scrape.yaml b/converter/internal/staticconvert/testdata/prom_scrape.yaml index b81e865ef5d0..afffa13a2054 100644 --- a/converter/internal/staticconvert/testdata/prom_scrape.yaml +++ b/converter/internal/staticconvert/testdata/prom_scrape.yaml @@ -19,6 +19,7 @@ metrics: batch_send_deadline: 3m max_shards: 10 max_backoff: 10s + sample_age_limit: 50s basic_auth: username: 11111 password: my-secret-password-here diff --git a/converter/internal/staticconvert/testdata/promtail_prom.river b/converter/internal/staticconvert/testdata/promtail_prom.river index e31469f5267b..1744d37aee5c 100644 --- a/converter/internal/staticconvert/testdata/promtail_prom.river +++ b/converter/internal/staticconvert/testdata/promtail_prom.river @@ -18,7 +18,7 @@ prometheus.scrape "metrics_name_jobName" { prometheus.remote_write "metrics_name" { endpoint { - name = "name-8be96f" + name = "name-149bbd" url = "http://localhost:9009/api/prom/push" queue_config { } diff --git a/converter/internal/staticconvert/testdata/sanitize.river b/converter/internal/staticconvert/testdata/sanitize.river index 1bf214eda874..eaacf45291b6 100644 --- a/converter/internal/staticconvert/testdata/sanitize.river +++ b/converter/internal/staticconvert/testdata/sanitize.river @@ -1,6 +1,6 @@ prometheus.remote_write "metrics_integrations" { endpoint { - name = "integrations-717d0f" + name = "integrations-ce3432" url = "https://region.grafana.net/api/prom/push" basic_auth { diff --git a/converter/internal/staticconvert/testdata/unsupported.river b/converter/internal/staticconvert/testdata/unsupported.river index 8c0909bb6c7f..76923a6c7f06 100644 --- a/converter/internal/staticconvert/testdata/unsupported.river +++ b/converter/internal/staticconvert/testdata/unsupported.river @@ -8,7 +8,7 @@ prometheus.scrape "metrics_agent_prometheus" { prometheus.remote_write "metrics_agent" { endpoint { - name = "agent-d885f6" + name = "agent-eea444" url = "https://prometheus-us-central1.grafana.net/api/prom/push" queue_config { } @@ -41,7 +41,7 @@ prometheus.scrape "integrations_statsd_exporter" { prometheus.remote_write "integrations" { endpoint { - name = "agent-d885f6" + name = "agent-eea444" url = "https://prometheus-us-central1.grafana.net/api/prom/push" queue_config { } diff --git a/docs/sources/flow/reference/components/prometheus.remote_write.md b/docs/sources/flow/reference/components/prometheus.remote_write.md index 6348b7b9c3ff..f869343e0919 100644 --- a/docs/sources/flow/reference/components/prometheus.remote_write.md +++ b/docs/sources/flow/reference/components/prometheus.remote_write.md @@ -165,6 +165,7 @@ Name | Type | Description | Default | Required `min_backoff` | `duration` | Initial retry delay. The backoff time gets doubled for each retry. | `"30ms"` | no `max_backoff` | `duration` | Maximum retry delay. | `"5s"` | no `retry_on_http_429` | `bool` | Retry when an HTTP 429 status code is received. | `true` | no +`sample_age_limit` | `duration` | Maximum age of samples to send. | `"0s"` | no Each queue then manages a number of concurrent _shards_ which is responsible for sending a fraction of data to their respective endpoints. The number of @@ -191,6 +192,10 @@ responses should be treated as recoverable errors; other `HTTP 4xx` status code responses are never considered recoverable errors. When `retry_on_http_429` is enabled, `Retry-After` response headers from the servers are honored. +The `sample_age_limit` argument specifies the maximum age of samples to send. Any +samples older than the limit are dropped and won't be sent to the remote storage. +The default value is `0s`, which means that all samples are sent (feature is disabled). + ### metadata_config block Name | Type | Description | Default | Required diff --git a/go.mod b/go.mod index f8d9059376ab..852050ec69a0 100644 --- a/go.mod +++ b/go.mod @@ -142,7 +142,7 @@ require ( github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.66.0 github.com/prometheus-operator/prometheus-operator/pkg/client v0.66.0 github.com/prometheus/blackbox_exporter v0.24.1-0.20230623125439-bd22efa1c900 - github.com/prometheus/client_golang v1.17.0 + github.com/prometheus/client_golang v1.18.0 github.com/prometheus/client_model v0.5.0 github.com/prometheus/common v0.45.0 github.com/prometheus/consul_exporter v0.8.0 @@ -216,7 +216,7 @@ require ( golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa golang.org/x/net v0.18.0 golang.org/x/oauth2 v0.13.0 - golang.org/x/sys v0.14.1-0.20231108175955-e4099bfacb8c + golang.org/x/sys v0.15.0 golang.org/x/text v0.14.0 golang.org/x/time v0.3.0 google.golang.org/api v0.147.0 @@ -677,6 +677,14 @@ replace ( k8s.io/klog/v2 => github.com/simonpasquier/klog-gokit/v3 v3.3.0 ) +// TODO(marctc): remove replace directive once: +// +// * There is a release of Prometheus which contains +// prometheus/prometheus#13002 +// We use the last v1-related tag as the replace statement does not work for v2 +// tags without the v2 suffix to the module root. +replace github.com/prometheus/prometheus => github.com/grafana/prometheus v1.8.2-0.20240105105355-3e2c486167d2 // grafana/prometheus@drop-old-inmemory-samples-squashed-2 + replace gopkg.in/yaml.v2 => github.com/rfratto/go-yaml v0.0.0-20211119180816-77389c3526dc // Replace directives from Loki diff --git a/go.sum b/go.sum index d966bfea9876..410e895a31bd 100644 --- a/go.sum +++ b/go.sum @@ -1080,6 +1080,8 @@ github.com/grafana/opentelemetry-collector/service v0.0.0-20231018134914-c0109e0 github.com/grafana/opentelemetry-collector/service v0.0.0-20231018134914-c0109e052230/go.mod h1:kBdpzrqR2wJkOdg50yzp4dv+2XBMyeqTgF4lCx0hSpQ= github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520 h1:HnFWqxhoSF3WC7sKAdMZ+SRXvHLVZlZ3sbQjuUlTqkw= github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520/go.mod h1:+HPXgiOV0InDHcZ2jNijL1SOKvo0eEPege5fQA0+ICI= +github.com/grafana/prometheus v1.8.2-0.20240105105355-3e2c486167d2 h1:eJD8U9G91ID/pKsLjJnjqve8yv1NiE/l6dGYnwchPVM= +github.com/grafana/prometheus v1.8.2-0.20240105105355-3e2c486167d2/go.mod h1:SRw624aMAxTfryAcP8rOjg4S/sHHaetx2lyJJ2nM83g= github.com/grafana/pyroscope-go/godeltaprof v0.1.3 h1:eunWpv1B3Z7ZK9o4499EmQGlY+CsDmSZ4FbxjRx37uk= github.com/grafana/pyroscope-go/godeltaprof v0.1.3/go.mod h1:1HSPtjU8vLG0jE9JrTdzjgFqdJ/VgN7fvxBNq3luJko= github.com/grafana/pyroscope/api v0.2.0 h1:TzOxL0s6SiaLEy944ZAKgHcx/JDRJXu4O8ObwkqR6p4= @@ -1957,8 +1959,8 @@ github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -2010,8 +2012,6 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/prometheus/prometheus v0.48.1 h1:CTszphSNTXkuCG6O0IfpKdHcJkvvnAAE1GbELKS+NFk= -github.com/prometheus/prometheus v0.48.1/go.mod h1:SRw624aMAxTfryAcP8rOjg4S/sHHaetx2lyJJ2nM83g= github.com/prometheus/snmp_exporter v0.24.1 h1:AihTbJHurMo8bjtjJde8U+4gMEvpvYvT21Xbd4SzJgY= github.com/prometheus/snmp_exporter v0.24.1/go.mod h1:j6uIGkdR0DXvKn7HJtSkeDj//UY0sWmdd6XhvdBjln0= github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= @@ -2807,8 +2807,8 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.1-0.20231108175955-e4099bfacb8c h1:3kC/TjQ+xzIblQv39bCOyRk8fbEeJcDHwbyxPUU2BpA= -golang.org/x/sys v0.14.1-0.20231108175955-e4099bfacb8c/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= From c246cf896ce497d2821b4e18116e5b1493d3b199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Tudur=C3=AD?= Date: Fri, 5 Jan 2024 16:22:02 +0100 Subject: [PATCH 17/19] Update version to v0.39.0-rc.0 (#6053) --- CHANGELOG.md | 3 +++ docs/sources/_index.md | 2 +- pkg/operator/defaults.go | 2 +- tools/gen-versioned-files/agent-version.txt | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d9a28c0716..f72d18c9f49f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ internal API changes are not present. Main (unreleased) ----------------- +v0.39.0-rc.0 (2024-01-05) +------------------------- + ### Breaking changes - `otelcol.receiver.prometheus` will drop all `otel_scope_info` metrics when converting them to OTLP. (@wildum) diff --git a/docs/sources/_index.md b/docs/sources/_index.md index e12c414c491e..1a7a2a261874 100644 --- a/docs/sources/_index.md +++ b/docs/sources/_index.md @@ -9,7 +9,7 @@ title: Grafana Agent description: Grafana Agent is a flexible, performant, vendor-neutral, telemetry collector weight: 350 cascade: - AGENT_RELEASE: v0.38.1 + AGENT_RELEASE: v0.39.0-rc.0 OTEL_VERSION: v0.87.0 --- diff --git a/pkg/operator/defaults.go b/pkg/operator/defaults.go index b66cfb52289b..a518d884b0b1 100644 --- a/pkg/operator/defaults.go +++ b/pkg/operator/defaults.go @@ -2,7 +2,7 @@ package operator // Supported versions of the Grafana Agent. var ( - DefaultAgentVersion = "v0.38.1" + DefaultAgentVersion = "v0.39.0-rc.0" DefaultAgentBaseImage = "grafana/agent" DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion ) diff --git a/tools/gen-versioned-files/agent-version.txt b/tools/gen-versioned-files/agent-version.txt index b4a466a81031..f02ec0731bfa 100644 --- a/tools/gen-versioned-files/agent-version.txt +++ b/tools/gen-versioned-files/agent-version.txt @@ -1 +1 @@ -v0.38.1 +v0.39.0-rc.0 From c467eff70e899833e5cebe64299c34e5af303bde Mon Sep 17 00:00:00 2001 From: Christophe van de Kerchove Date: Fri, 5 Jan 2024 11:07:42 -0500 Subject: [PATCH 18/19] feat: Allow user to add service account labels (#6022) This can be useful to use OIDC required labels for grafana-agent to authenticate to services. For example, Azure Workload Identity requires a labels to set additional labels on the service account for it to function properly. Co-authored-by: christophe.vandekerchove --- .../helm/charts/grafana-agent/CHANGELOG.md | 2 + .../helm/charts/grafana-agent/README.md | 1 + ...dditional-serviceaccount-label-values.yaml | 3 + .../templates/serviceaccount.yaml | 3 + .../helm/charts/grafana-agent/values.yaml | 2 + .../grafana-agent/templates/configmap.yaml | 42 +++++++ .../templates/controllers/daemonset.yaml | 73 +++++++++++ .../grafana-agent/templates/rbac.yaml | 117 ++++++++++++++++++ .../grafana-agent/templates/service.yaml | 22 ++++ .../templates/serviceaccount.yaml | 13 ++ 10 files changed, 278 insertions(+) create mode 100644 operations/helm/charts/grafana-agent/ci/additional-serviceaccount-label-values.yaml create mode 100644 operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/configmap.yaml create mode 100644 operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml create mode 100644 operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/rbac.yaml create mode 100644 operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/service.yaml create mode 100644 operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/serviceaccount.yaml diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index d14525031740..8752c007df6f 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -14,6 +14,8 @@ Unreleased - Update `rbac` to include necessary rules for the `otelcol.processor.k8sattributes` component. (@rlankfo) +- Add `serviceAccount.additionalLabels` to values.yaml to enable setting additional labels on the created service account. (@zopanix) + ### Bugfixes - Statefulset should use value `.controller.enableStatefulSetAutoDeletePVC` instead of just `.enableStatefulSetAutoDeletePVC`. (@captncraig) diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index 1839e56ed202..76aea9536d92 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -118,6 +118,7 @@ use the older mode (called "static mode"), set the `agent.mode` value to | service.clusterIP | string | `""` | Cluster IP, can be set to None, empty "" or an IP address | | service.enabled | bool | `true` | Creates a Service for the controller's pods. | | service.type | string | `"ClusterIP"` | Service type | +| serviceAccount.additionalLabels | object | `{}` | Additional labels to add to the created service account. | | serviceAccount.annotations | object | `{}` | Annotations to add to the created service account. | | serviceAccount.create | bool | `true` | Whether to create a service account for the Grafana Agent deployment. | | serviceAccount.name | string | `nil` | The name of the existing service account to use when serviceAccount.create is false. | diff --git a/operations/helm/charts/grafana-agent/ci/additional-serviceaccount-label-values.yaml b/operations/helm/charts/grafana-agent/ci/additional-serviceaccount-label-values.yaml new file mode 100644 index 000000000000..91b7cbb7c258 --- /dev/null +++ b/operations/helm/charts/grafana-agent/ci/additional-serviceaccount-label-values.yaml @@ -0,0 +1,3 @@ +serviceAccount: + additionalLabels: + test: "true" diff --git a/operations/helm/charts/grafana-agent/templates/serviceaccount.yaml b/operations/helm/charts/grafana-agent/templates/serviceaccount.yaml index 8f4c8477a7d5..766201635e77 100644 --- a/operations/helm/charts/grafana-agent/templates/serviceaccount.yaml +++ b/operations/helm/charts/grafana-agent/templates/serviceaccount.yaml @@ -5,6 +5,9 @@ metadata: name: {{ include "grafana-agent.serviceAccountName" . }} labels: {{- include "grafana-agent.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/operations/helm/charts/grafana-agent/values.yaml b/operations/helm/charts/grafana-agent/values.yaml index 7b80e68618e6..dd94b3b09118 100644 --- a/operations/helm/charts/grafana-agent/values.yaml +++ b/operations/helm/charts/grafana-agent/values.yaml @@ -115,6 +115,8 @@ rbac: serviceAccount: # -- Whether to create a service account for the Grafana Agent deployment. create: true + # -- Additional labels to add to the created service account. + additionalLabels: {} # -- Annotations to add to the created service account. annotations: {} # -- The name of the existing service account to use when diff --git a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/configmap.yaml b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/configmap.yaml new file mode 100644 index 000000000000..2fdc6f011777 --- /dev/null +++ b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/configmap.yaml @@ -0,0 +1,42 @@ +--- +# Source: grafana-agent/templates/configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-agent + labels: + helm.sh/chart: grafana-agent + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + app.kubernetes.io/version: "vX.Y.Z" + app.kubernetes.io/managed-by: Helm +data: + config.river: |- + logging { + level = "info" + format = "logfmt" + } + + discovery.kubernetes "pods" { + role = "pod" + } + + discovery.kubernetes "nodes" { + role = "node" + } + + discovery.kubernetes "services" { + role = "service" + } + + discovery.kubernetes "endpoints" { + role = "endpoints" + } + + discovery.kubernetes "endpointslices" { + role = "endpointslice" + } + + discovery.kubernetes "ingresses" { + role = "ingress" + } diff --git a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml new file mode 100644 index 000000000000..7ac89ceb865a --- /dev/null +++ b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/controllers/daemonset.yaml @@ -0,0 +1,73 @@ +--- +# Source: grafana-agent/templates/controllers/daemonset.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: grafana-agent + labels: + helm.sh/chart: grafana-agent + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + app.kubernetes.io/version: "vX.Y.Z" + app.kubernetes.io/managed-by: Helm +spec: + minReadySeconds: 10 + selector: + matchLabels: + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + template: + metadata: + labels: + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + spec: + serviceAccountName: grafana-agent + containers: + - name: grafana-agent + image: docker.io/grafana/agent:v0.38.1 + imagePullPolicy: IfNotPresent + args: + - run + - /etc/agent/config.river + - --storage.path=/tmp/agent + - --server.http.listen-addr=0.0.0.0:80 + - --server.http.ui-path-prefix=/ + env: + - name: AGENT_MODE + value: flow + - name: AGENT_DEPLOY_MODE + value: "helm" + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + ports: + - containerPort: 80 + name: http-metrics + readinessProbe: + httpGet: + path: /-/ready + port: 80 + initialDelaySeconds: 10 + timeoutSeconds: 1 + volumeMounts: + - name: config + mountPath: /etc/agent + - name: config-reloader + image: docker.io/jimmidyson/configmap-reload:v0.8.0 + args: + - --volume-dir=/etc/agent + - --webhook-url=http://localhost:80/-/reload + volumeMounts: + - name: config + mountPath: /etc/agent + resources: + requests: + cpu: 1m + memory: 5Mi + dnsPolicy: ClusterFirst + volumes: + - name: config + configMap: + name: grafana-agent diff --git a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/rbac.yaml b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/rbac.yaml new file mode 100644 index 000000000000..3765583fb64f --- /dev/null +++ b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/rbac.yaml @@ -0,0 +1,117 @@ +--- +# Source: grafana-agent/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: grafana-agent + labels: + helm.sh/chart: grafana-agent + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + app.kubernetes.io/version: "vX.Y.Z" + app.kubernetes.io/managed-by: Helm +rules: + # Rules which allow discovery.kubernetes to function. + - apiGroups: + - "" + - "discovery.k8s.io" + - "networking.k8s.io" + resources: + - endpoints + - endpointslices + - ingresses + - nodes + - nodes/proxy + - nodes/metrics + - pods + - services + verbs: + - get + - list + - watch + # Rules which allow loki.source.kubernetes and loki.source.podlogs to work. + - apiGroups: + - "" + resources: + - pods + - pods/log + - namespaces + verbs: + - get + - list + - watch + - apiGroups: + - "monitoring.grafana.com" + resources: + - podlogs + verbs: + - get + - list + - watch + # Rules which allow mimir.rules.kubernetes to work. + - apiGroups: ["monitoring.coreos.com"] + resources: + - prometheusrules + verbs: + - get + - list + - watch + - nonResourceURLs: + - /metrics + verbs: + - get + # Rules for prometheus.kubernetes.* + - apiGroups: ["monitoring.coreos.com"] + resources: + - podmonitors + - servicemonitors + - probes + verbs: + - get + - list + - watch + # Rules which allow eventhandler to work. + - apiGroups: + - "" + resources: + - events + verbs: + - get + - list + - watch + # needed for remote.kubernetes.* + - apiGroups: [""] + resources: + - "configmaps" + - "secrets" + verbs: + - get + - list + - watch + # needed for otelcol.processor.k8sattributes + - apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] + - apiGroups: ["extensions"] + resources: ["replicasets"] + verbs: ["get", "list", "watch"] +--- +# Source: grafana-agent/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: grafana-agent + labels: + helm.sh/chart: grafana-agent + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + app.kubernetes.io/version: "vX.Y.Z" + app.kubernetes.io/managed-by: Helm +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: grafana-agent +subjects: + - kind: ServiceAccount + name: grafana-agent + namespace: default diff --git a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/service.yaml b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/service.yaml new file mode 100644 index 000000000000..04f6eeff3c4d --- /dev/null +++ b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/service.yaml @@ -0,0 +1,22 @@ +--- +# Source: grafana-agent/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: grafana-agent + labels: + helm.sh/chart: grafana-agent + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + app.kubernetes.io/version: "vX.Y.Z" + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + selector: + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + ports: + - name: http-metrics + port: 80 + targetPort: 80 + protocol: "TCP" diff --git a/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/serviceaccount.yaml b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/serviceaccount.yaml new file mode 100644 index 000000000000..ba80344cee51 --- /dev/null +++ b/operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +--- +# Source: grafana-agent/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: grafana-agent + labels: + helm.sh/chart: grafana-agent + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: grafana-agent + app.kubernetes.io/version: "vX.Y.Z" + app.kubernetes.io/managed-by: Helm + test: "true" From cbdfc8733c24405c3e5edaba63ab19f456d3b4a4 Mon Sep 17 00:00:00 2001 From: Craig Peterson <192540+captncraig@users.noreply.github.com> Date: Fri, 5 Jan 2024 12:10:25 -0500 Subject: [PATCH 19/19] create new helm release 0.30.0 (#6057) * create new helm release * gen --- operations/helm/charts/grafana-agent/CHANGELOG.md | 3 +++ operations/helm/charts/grafana-agent/Chart.yaml | 2 +- operations/helm/charts/grafana-agent/README.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index 8752c007df6f..6603ab6fb063 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -10,6 +10,9 @@ internal API changes are not present. Unreleased ---------- +0.30.0 (2024-01-05) +------------------- + ### Enhancements - Update `rbac` to include necessary rules for the `otelcol.processor.k8sattributes` component. (@rlankfo) diff --git a/operations/helm/charts/grafana-agent/Chart.yaml b/operations/helm/charts/grafana-agent/Chart.yaml index 78630fed515d..45ab45dd8ba2 100644 --- a/operations/helm/charts/grafana-agent/Chart.yaml +++ b/operations/helm/charts/grafana-agent/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: grafana-agent description: 'Grafana Agent' type: application -version: 0.29.0 +version: 0.30.0 appVersion: 'v0.38.1' dependencies: diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index 76aea9536d92..98e4219d36b5 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -1,6 +1,6 @@ # Grafana Agent Helm chart -![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.29.0](https://img.shields.io/badge/Version-0.29.0-informational?style=flat-square) ![AppVersion: v0.38.1](https://img.shields.io/badge/AppVersion-v0.38.1-informational?style=flat-square) +![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.30.0](https://img.shields.io/badge/Version-0.30.0-informational?style=flat-square) ![AppVersion: v0.38.1](https://img.shields.io/badge/AppVersion-v0.38.1-informational?style=flat-square) Helm chart for deploying [Grafana Agent][] to Kubernetes.