Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 #15088

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 1, 2024

Bumps github.com/prometheus/client_golang from 1.18.0 to 1.19.0.

Release notes

Sourced from github.com/prometheus/client_golang's releases.

v1.19.0

What's Changed

The module prometheus/common v0.48.0 introduced an incompatibility when used together with client_golang (See prometheus/client_golang#1448 for more details). If your project uses client_golang and you want to use prometheus/common v0.48.0 or higher, please update client_golang to v1.19.0.

  • [CHANGE] Minimum required go version is now 1.20 (we also test client_golang against new 1.22 version). #1445 #1449
  • [FEATURE] collectors: Add version collector. #1422 #1427

New Contributors

Full Changelog: prometheus/client_golang@v1.18.0...v1.19.0

Changelog

Sourced from github.com/prometheus/client_golang's changelog.

1.19.0 / 2023-02-27

The module prometheus/common v0.48.0 introduced an incompatibility when used together with client_golang (See prometheus/client_golang#1448 for more details). If your project uses client_golang and you want to use prometheus/common v0.48.0 or higher, please update client_golang to v1.19.0.

  • [CHANGE] Minimum required go version is now 1.20 (we also test client_golang against new 1.22 version). #1445 #1449
  • [FEATURE] collectors: Add version collector. #1422 #1427
Commits
  • 77d4003 Add 1.19.0 changelog (#1451)
  • 14259fa Merge pull request #1448 from ywwg/owilliams/content-negotiation
  • 6d03920 deps: bump prometheus/common version
  • 353395b Remove support for go 1.19 (#1449)
  • 9dd5d2a Merge pull request #1445 from kavu/add_go122_metrics_test
  • c906a5e Add support for Go 1.22
  • 7ac9036 Merge pull request #1440 from prometheus/dependabot/github_actions/github-act...
  • 8c7e30f Merge pull request #1441 from prometheus/dependabot/go_modules/tutorial/whats...
  • 08769f8 Bump github.com/prometheus/common in /tutorial/whatsup
  • 83d5940 Bump the github-actions group with 2 updates
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.18.0...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Apr 1, 2024
@telegraf-tiger telegraf-tiger bot added the chore label Apr 1, 2024
@powersj
Copy link
Contributor

powersj commented Apr 2, 2024

It looks like https://github.com/prometheus/common/pull/576/files is the upstream change that has unexported some of the format strings. I have the following diff to switch over, however the protobuf tests continue to fail for the prometheus parser. Specifically the TestCases/protobuf_v1 and TestCases/protobuf_v2 tests fail:

diff --git plugins/parsers/prometheus/parser.go plugins/parsers/prometheus/parser.go
index 46884ec3b..62db36a39 100644
--- plugins/parsers/prometheus/parser.go
+++ plugins/parsers/prometheus/parser.go
@@ -30,14 +30,14 @@ func (p *Parser) Parse(data []byte) ([]telegraf.Metric, error) {
 	// Determine the metric transport-type derived from the response header and
 	// create a matching decoder.
 	format := expfmt.ResponseFormat(p.Header)
-	switch format {
-	case expfmt.FmtProtoText:
+	switch format.FormatType() {
+	case expfmt.TypeProtoText:
 		// Make sure we have a finishing newline but no trailing one
 		data = bytes.TrimPrefix(data, []byte("\n"))
 		if !bytes.HasSuffix(data, []byte("\n")) {
 			data = append(data, []byte("\n")...)
 		}
-	case expfmt.FmtUnknown:
+	case expfmt.TypeUnknown:
 		p.Log.Debugf("Unknown format %q... Trying to continue...", p.Header.Get("Content-Type"))
 	}
 	buf := bytes.NewBuffer(data)
diff --git plugins/serializers/prometheus/prometheus.go plugins/serializers/prometheus/prometheus.go
index 215754cb2..e2a7b34e8 100644
--- plugins/serializers/prometheus/prometheus.go
+++ plugins/serializers/prometheus/prometheus.go
@@ -76,7 +76,7 @@ func (s *Serializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error) {
 
 	var buf bytes.Buffer
 	for _, mf := range coll.GetProto() {
-		enc := expfmt.NewEncoder(&buf, expfmt.FmtText)
+		enc := expfmt.NewEncoder(&buf, expfmt.NewFormat(expfmt.TypeTextPlain))
 		err := enc.Encode(mf)
 		if err != nil {
 			return nil, err

@srebhan
Copy link
Contributor

srebhan commented Apr 3, 2024

@powersj there is an underlying issue with the way they decode now. My fix can be found in prometheus/common#616.

@powersj
Copy link
Contributor

powersj commented Apr 3, 2024

@srebhan thanks for figuring that out. Do we want to close this PR then for now and update only once your PR is landed and released? We can tell dependabot to ignore this minor version.

@srebhan
Copy link
Contributor

srebhan commented Apr 3, 2024

@powersj yeah I think that would be a good idea.

@dependabot ignore this minor version

@dependabot dependabot bot closed this Apr 3, 2024
Copy link
Contributor Author

dependabot bot commented on behalf of github Apr 3, 2024

OK, I won't notify you about version 1.19.x again, unless you re-open this PR.

@dependabot dependabot bot deleted the dependabot/go_modules/github.com/prometheus/client_golang-1.19.0 branch April 3, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants