Skip to content

Commit

Permalink
Merge branch 'main' into bubble-up-ssh-key-conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
hainenber authored May 29, 2024
2 parents 03d6e36 + 71c904c commit 4d1f50b
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 43 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -78,6 +80,11 @@ 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.

- Bubble up SSH key conversion error to facilitate failed `import.git`. (@hainenber)

### Other changes

- `pyroscope.ebpf`, `pyroscope.java`, `pyroscope.scrape`, `pyroscope.write` and `discovery.process` components are now GA. (@korniltsev)
Expand All @@ -91,9 +98,6 @@ Main (unreleased)

- Updated Prometheus dependency to [v2.51.2](https://github.com/prometheus/prometheus/releases/tag/v2.51.2) (@thampiotr)

- Bubble up SSH key conversion error to facilitate failed `import.git`. (@hainenber)


v1.1.0
------

Expand Down
84 changes: 63 additions & 21 deletions docs/make-docs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <<EOF
${PODMAN} run \
--init \
--interactive \
--platform linux/amd64 \
--rm \
--tty \
${volumes} \
"${DOCS_IMAGE}" \
"--include=${DOC_VALIDATOR_INCLUDE}" \
"--skip-checks=${DOC_VALIDATOR_SKIP_CHECKS}" \
"/hugo/content$(proj_canonical "${proj}")" \
"$(proj_canonical "${proj}")" \
| sed "s#$(proj_dst "${proj}")#sources#" \
| 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'
${DOCS_IMAGE} \
--include=${DOC_VALIDATOR_INCLUDE} \
--skip-checks=${DOC_VALIDATOR_SKIP_CHECKS} \
/hugo/content$(proj_canonical "${proj}") \
"$(proj_canonical "${proj}") \
| sed "s#$(proj_dst "${proj}")#sources#"
EOF

case "${OUTPUT_FORMAT}" in
human)
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

${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 <<EOF
${PODMAN} run \
--init \
--interactive \
--rm \
--workdir /etc/vale \
--tty \
${volumes} \
"${DOCS_IMAGE}" \
"--minAlertLevel=${VALE_MINALERTLEVEL}" \
'--glob=*.md' \
--output=/etc/vale/rdjsonl.tmpl \
/hugo/content/docs | sed "s#$(proj_dst "${proj}")#sources#"
${DOCS_IMAGE} \
--minAlertLevel=${VALE_MINALERTLEVEL} \
--glob=*.md \
/hugo/content/docs
EOF

case "${OUTPUT_FORMAT}" in
human)
${cmd} --output=line \
| sed "s#$(proj_dst "${proj}")#sources#"
;;
json)
${cmd} --output=/etc/vale/rdjsonl.tmpl \
| sed "s#$(proj_dst "${proj}")#sources#"
;;
*)
errr "Invalid output format '${OUTPUT_FORMAT}'"
esac

;;
*)
tempfile="$(mktemp -t make-docs.XXX)"
Expand Down
14 changes: 7 additions & 7 deletions docs/sources/reference/components/discovery.dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/reference/components/faro.receiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
19 changes: 15 additions & 4 deletions example/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions example/images/jb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM golang:1.22-alpine

RUN go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@c862f0670eb199b5024e31ff024f39b74d3b803a
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion internal/component/discovery/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 4d1f50b

Please sign in to comment.