From 8c46be32dc2e5cd46b0dd89d4c0a2ef64f4df883 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Tue, 28 May 2024 10:01:23 -0400 Subject: [PATCH 1/5] example: install jb dependencies before provisioning (#941) grafana/alloy#808 introduced dependencies for the mixin, which accidentally broke the example environment; as the mixin originally didn't have dependencies, the example environment didn't install them before provisioning dashboards. This commit runs jb to locally install dependencies before provisioning dashboards. --- example/grafana.yaml | 19 +++++++++++++++---- example/images/jb/Dockerfile | 3 +++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 example/images/jb/Dockerfile diff --git a/example/grafana.yaml b/example/grafana.yaml index e93c7d6e5b..2bd25bb638 100644 --- a/example/grafana.yaml +++ b/example/grafana.yaml @@ -16,13 +16,24 @@ services: timeout: 10s retries: 5 + install-dashboard-dependencies: + build: images/jb + restart: on-failure + depends_on: + grafana: + condition: service_healthy + volumes: + - ../operations/alloy-mixin:/etc/alloy-mixin + working_dir: /etc/alloy-mixin + command: jb install + # Provision alloy-mixin after Grafana is healthy and running. provision-dashboards: build: images/grizzly restart: on-failure depends_on: - grafana: - condition: service_healthy + install-dashboard-dependencies: + condition: service_completed_successfully environment: - GRAFANA_URL=http://grafana:3000 volumes: @@ -35,8 +46,8 @@ services: build: images/grizzly restart: on-failure depends_on: - grafana: - condition: service_healthy + install-dashboard-dependencies: + condition: service_completed_successfully environment: - GRAFANA_URL=http://grafana:3000 volumes: diff --git a/example/images/jb/Dockerfile b/example/images/jb/Dockerfile new file mode 100644 index 0000000000..82543f33d8 --- /dev/null +++ b/example/images/jb/Dockerfile @@ -0,0 +1,3 @@ +FROM golang:1.22-alpine + +RUN go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@c862f0670eb199b5024e31ff024f39b74d3b803a From c887aee2db184dba53f6540583f7e6cfb54f1b4a Mon Sep 17 00:00:00 2001 From: Paulin Todev Date: Tue, 28 May 2024 16:46:13 +0100 Subject: [PATCH 2/5] Added support for NS records to discovery.dns (#942) --- CHANGELOG.md | 2 ++ docs/sources/reference/components/discovery.dns.md | 14 +++++++------- internal/component/discovery/dns/dns.go | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79fef0fca4..f9366f11af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,8 @@ Main (unreleased) - Allow override debug metrics level for `otelcol.*` components. (@hainenber) +- Added support for NS records to `discovery.dns`. (@djcode) + ### Bugfixes - Fix panic when component ID contains `/` in `otelcomponent.MustNewType(ID)`.(@qclaogui) diff --git a/docs/sources/reference/components/discovery.dns.md b/docs/sources/reference/components/discovery.dns.md index ea7b766c98..ff3b6783da 100644 --- a/docs/sources/reference/components/discovery.dns.md +++ b/docs/sources/reference/components/discovery.dns.md @@ -20,12 +20,12 @@ discovery.dns "LABEL" { The following arguments are supported: -Name | Type | Description | Default | Required --------------------|----------------|------------------------------------------------------------------|---------|--------- -`names` | `list(string)` | DNS names to look up. | | yes -`port` | `number` | Port to use for collecting metrics. Not used for SRV records. | `0` | no -`refresh_interval` | `duration` | How often to query DNS for updates. | `"30s"` | no -`type` | `string` | Type of DNS record to query. Must be one of SRV, A, AAAA, or MX. | `"SRV"` | no +Name | Type | Description | Default | Required +-------------------|----------------|----------------------------------------------------------------------|---------|--------- +`names` | `list(string)` | DNS names to look up. | | yes +`port` | `number` | Port to use for collecting metrics. Not used for SRV records. | `0` | no +`refresh_interval` | `duration` | How often to query DNS for updates. | `"30s"` | no +`type` | `string` | Type of DNS record to query. Must be one of SRV, A, AAAA, MX, or NS. | `"SRV"` | no ## Exported fields @@ -41,7 +41,7 @@ Each target includes the following labels: * `__meta_dns_srv_record_target`: Target field of the SRV record. * `__meta_dns_srv_record_port`: Port field of the SRV record. * `__meta_dns_mx_record_target`: Target field of the MX record. - +* `__meta_dns_ns_record_target`: Target field of the NS record. ## Component health diff --git a/internal/component/discovery/dns/dns.go b/internal/component/discovery/dns/dns.go index 1f1be5a343..66832290e2 100644 --- a/internal/component/discovery/dns/dns.go +++ b/internal/component/discovery/dns/dns.go @@ -49,7 +49,7 @@ func (args *Arguments) SetToDefault() { func (args *Arguments) Validate() error { switch strings.ToUpper(args.Type) { case "SRV": - case "A", "AAAA", "MX": + case "A", "AAAA", "MX", "NS": if args.Port == 0 { return errors.New("a port is required in DNS-SD configs for all record types except SRV") } From f39835182283b154edd1c517b7d6b0eb2c09d2f7 Mon Sep 17 00:00:00 2001 From: Igor Estevan Jasinski <108187126+igorestevanjasinski@users.noreply.github.com> Date: Tue, 28 May 2024 13:49:23 -0300 Subject: [PATCH 3/5] Update Faro receiver docs (#624) Include /loki/ at loki.write endpoint --- docs/sources/reference/components/faro.receiver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/reference/components/faro.receiver.md b/docs/sources/reference/components/faro.receiver.md index 344c2e7b3e..44cce96ed8 100644 --- a/docs/sources/reference/components/faro.receiver.md +++ b/docs/sources/reference/components/faro.receiver.md @@ -208,7 +208,7 @@ faro.receiver "default" { loki.write "default" { endpoint { - url = "https://LOKI_ADDRESS/api/v1/push" + url = "https://LOKI_ADDRESS/loki/api/v1/push" } } From 551d4072dec6d36ccdff2d9ed2e4a2b3433bd6ac Mon Sep 17 00:00:00 2001 From: Stefan Kurek Date: Wed, 29 May 2024 03:31:44 -0400 Subject: [PATCH 4/5] updates with latest snowflake prometheus exporter (fixes null issues) (#939) * updates with latest snowflake prometheus exporter (fixes null issues) * Update CHANGELOG.md Co-authored-by: William Dumont --------- Co-authored-by: William Dumont --- CHANGELOG.md | 4 +++- go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9366f11af..0096a7f21b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,9 @@ Main (unreleased) - Fix an issue where having long component labels (>63 chars) on otelcol.auth components lead to a panic. (@tpaschalis) +- Update `prometheus.exporter.snowflake` with the [latest](https://github.com/grafana/snowflake-prometheus-exporter) version of the exporter as of May 28, 2024 (@StefanKurek) + - Fixes issue where returned `NULL` values from database could cause unexpected errors. + ### Other changes - `pyroscope.ebpf`, `pyroscope.java`, `pyroscope.scrape`, `pyroscope.write` and `discovery.process` components are now GA. (@korniltsev) @@ -93,7 +96,6 @@ Main (unreleased) - Updated Prometheus dependency to [v2.51.2](https://github.com/prometheus/prometheus/releases/tag/v2.51.2) (@thampiotr) - v1.1.0 ------ diff --git a/go.mod b/go.mod index 7d2579bbee..e530dfbd15 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,7 @@ require ( github.com/grafana/pyroscope/api v0.4.0 github.com/grafana/pyroscope/ebpf v0.4.7 github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db - github.com/grafana/snowflake-prometheus-exporter v0.0.0-20221213150626-862cad8e9538 + github.com/grafana/snowflake-prometheus-exporter v0.0.0-20240524135656-12b7c9be6cbf github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0 github.com/grafana/vmware_exporter v0.0.5-beta github.com/hashicorp/consul/api v1.28.2 @@ -648,7 +648,7 @@ require ( github.com/xo/dburl v0.20.0 // indirect github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 // indirect github.com/yl2chen/cidranger v1.0.2 // indirect - github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.etcd.io/etcd/api/v3 v3.5.10 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect diff --git a/go.sum b/go.sum index 940698c18c..4d6493d838 100644 --- a/go.sum +++ b/go.sum @@ -1056,8 +1056,8 @@ github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzed github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/grafana/smimesign v0.2.1-0.20220408144937-2a5adf3481d3 h1:UPkAxuhlAcRmJT3/qd34OMTl+ZU7BLLfOO2+NXBlJpY= github.com/grafana/smimesign v0.2.1-0.20220408144937-2a5adf3481d3/go.mod h1:iZiiwNT4HbtGRVqCQu7uJPEZCuEE5sfSSttcnePkDl4= -github.com/grafana/snowflake-prometheus-exporter v0.0.0-20221213150626-862cad8e9538 h1:tkT0yha3JzB5S5VNjfY4lT0cJAe20pU8XGt3Nuq73rM= -github.com/grafana/snowflake-prometheus-exporter v0.0.0-20221213150626-862cad8e9538/go.mod h1:VxVydRyq8f6w1qmX/5MSYIdSbgujre8rdFRLgU6u/RI= +github.com/grafana/snowflake-prometheus-exporter v0.0.0-20240524135656-12b7c9be6cbf h1:272jCM4WJtrv4JsVTyjSlzRavZRur60rBGgaCKQOK5k= +github.com/grafana/snowflake-prometheus-exporter v0.0.0-20240524135656-12b7c9be6cbf/go.mod h1:DANNLd5vSKqHloqNX4yeS+9ZRI89dj8ySZeEWlI5UU4= github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0 h1:bjh0PVYSVVFxzINqPFYJmAmJNrWPgnVjuSdYJGHmtFU= github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0/go.mod h1:7t5XR+2IA8P2qggOAHTj/GCZfoLBle3OvNSYh1VkRBU= github.com/grafana/vmware_exporter v0.0.5-beta h1:2JCqzIWJzns8FN78wPsueC9rT3e3kZo2OUoL5kGMjdM= @@ -2225,8 +2225,8 @@ github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 h1:zzrxE1FKn5ryB github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY= github.com/yl2chen/cidranger v1.0.2 h1:lbOWZVCG1tCRX4u24kuM1Tb4nHqWkDxwLdoS+SevawU= github.com/yl2chen/cidranger v1.0.2/go.mod h1:9U1yz7WPYDwf0vpNWFaeRh0bjwz5RVgRy/9UEQfHl0g= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 h1:tBiBTKHnIjovYoLX/TPkcf+OjqqKGQrPtGT3Foz+Pgo= +github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76/go.mod h1:SQliXeA7Dhkt//vS29v3zpbEwoa+zb2Cn5xj5uO4K5U= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 71c904c904a9d1f7fa8e571ab0ac5205eaa24032 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 09:21:16 +0100 Subject: [PATCH 5/5] Update `make docs` procedure (#950) Co-authored-by: grafanabot --- docs/make-docs | 84 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 21 deletions(-) diff --git a/docs/make-docs b/docs/make-docs index 0a1730e6c6..f531df2ebb 100755 --- a/docs/make-docs +++ b/docs/make-docs @@ -6,6 +6,17 @@ # [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes. # Changes are relevant to this script and the support docs.mk GNU Make interface. # +# ## 8.0.0 (2024-05-28) +# +# ### Changed +# +# - Add environment variable `OUTPUT_FORMAT` to control the output of commands. +# +# The default value is `human` and means the output format is human readable. +# The value `json` is also supported and outputs JSON. +# +# Note that the `json` format isn't supported by `make docs`, only `make doc-validator` and `make vale`. +# # ## 7.0.0 (2024-05-03) # # ### Changed @@ -255,6 +266,8 @@ readonly HUGO_REFLINKSERRORLEVEL="${HUGO_REFLINKSERRORLEVEL:-WARNING}" readonly VALE_MINALERTLEVEL="${VALE_MINALERTLEVEL:-error}" readonly WEBSITE_EXEC="${WEBSITE_EXEC:-make server-docs}" +readonly OUTPUT_FORMAT="${OUTPUT_FORMAT:-human}" + PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)" if ! command -v curl >/dev/null 2>&1; then @@ -748,45 +761,74 @@ POSIX_HERESTRING case "${image}" in 'grafana/doc-validator') - if ! command -v jq >/dev/null 2>&1; then - errr '`jq` must be installed for the `doc-validator` target to work.' - note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,' - - exit 1 - fi - proj="$(new_proj "$1")" printf '\r\n' - "${PODMAN}" run \ + + IFS='' read -r cmd </dev/null 2>&1; then + errr '`jq` must be installed for the `doc-validator` target to work.' + note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,' + + exit 1 + fi + + ${cmd} \ + | jq -r '"ERROR: \(.location.path):\(.location.range.start.line // 1):\(.location.range.start.column // 1): \(.message)" + if .suggestions[0].text then "\nSuggestion: \(.suggestions[0].text)" else "" end' + ;; + json) + ${cmd} + ;; + *) # default + errr "Invalid output format '${OUTPUT_FORMAT}'" + esac ;; 'grafana/vale') proj="$(new_proj "$1")" printf '\r\n' - "${PODMAN}" run \ + IFS='' read -r cmd <