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

feat: new promslog and promslog/flag packages to wrap log/slog #677

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

tjhop
Copy link
Contributor

@tjhop tjhop commented Aug 16, 2024

Prereq for prometheus/prometheus#14355

This adds a new promslog package to create an opinionated slog logger
for use within the prometheus ecosystem. By default, logs are written at
info level and formatted to add a kv pair for the source caller. If
backwards compatibility for the literal output format of the logging is
required, logs can be styled in a format that is similar to how the
promlog package formatted it's go-kit/log output [1]. The promslog
package also makes use of an slog.LevelVar to dynamically adjust the
level of an existing logger. Similar to the old promlog package, we
provide means to log in logfmt and json output formats.

Creating a logger is similar to the old promlog package -- optionally
populate a Config struct, and then call New() with the config.

In order to dynamically adjust the logger's level, retain the Config
struct as it's own variable to access the AllowedLevel.Set() method,
which internally updates the AllowedLevel's slog.LevelVar to the
desired log level. Ex:

config := &promslog.Config{} // Retain as variable if you need to dynamically adjust log level
logger := promslog.New(config)
config.Level.Set("debug")
logger.Debug("your message here", "hello", "world")

To use go-kit style log output:

config := &promslog.Config{Style: promslog.GoKitStyle} // Retain as variable if you need to dynamically adjust log level
logger := promslog.New(config)
config.Level.Set("debug")
logger.Debug("your message here", "hello", "world")
  1. When using the go-kit log style, the following changes are made to the
    default slog output:
  • adjusts slog default timestamp key from timestamp -> ts
  • adjusts the timestamp value to use the same time format string
    ("2006-01-02T15:04:05.000Z07:00")
  • adjusts slog default sourcecode key from source -> caller
  • adjusts the formatting of the sourcecode values to trim paths with
    filepath.Base(). The formatting of the sourcecode value is similar
    to the go-kit/log usage, with the addition of the source function in
    parenthesis when debug logging is enabled.

Signed-off-by: TJ Hoplock [email protected]

@tjhop tjhop force-pushed the feat/add-promslog-pkg branch 2 times, most recently from 5d8a321 to fe62144 Compare August 16, 2024 21:20
@tjhop
Copy link
Contributor Author

tjhop commented Aug 17, 2024

@SuperQ @beorn7:

This should be ready for review now. I believe I was able to set things up in a way where flag interactions can remain consistent (by also creating a new promslog/flag package to pair with the logger). Formatting for the literal log lines themselves should be pretty close old formatting of the logger from promlog, with the exception of the value of the caller source key -- I didn't look into trying to tap into runtime.Caller() myself for slog, as is used behind the scenes when we call log.Caller() here.

Feedback welcome!

@SuperQ
Copy link
Member

SuperQ commented Aug 17, 2024

Nice!

My only question so far is how much we care about keeping the same log line formatting as before. Since this is intended for Prometheus 3.0, we can make breaking changes.

Do we want to deviate from some of the minor slog defaults for formatting? Or use this as an opportunity to reset.

@tjhop
Copy link
Contributor Author

tjhop commented Aug 17, 2024

We can certainly use it as an opportunity to reset -- my primary thought was that by maintaining log formatting, we would cause the least downstream disruption for anything that is parsing the resulting log lines. We're ok with making the breaking changes to formatting for prometheus because of the 3.0 release, but any other downstream projects would also inherit those formatting changes.

I'd like to not be the cause of someone getting paged in the middle of the night because an upgrade to $someService was done and their loki recording/alerting rules broke from unexpected formatting changes, etc 🙃

@SuperQ
Copy link
Member

SuperQ commented Aug 18, 2024

So let's break this down into individual decisions:

  1. adjusts slog default timestamp key from timestamp -> ts
  2. adjusts the timestamp value to use the same time format string
    ("2006-01-02T15:04:05.000Z07:00")
  3. adjusts slog default sourcecode key from source -> caller
  4. adjusts the formatting of the sourcecode values to trim paths with
    filepath.Base(). The formatting of the sourcecode value is similar
    to the go-kit/log usage, with the addition of the source function in
    parenthesis when debug logging is enabled.

My vote:

  1. Yes
  2. No
  3. No
  4. Maybe

The other option is we add an additional formatting config/flag. --log.style=(slog|go-kit).

@tjhop
Copy link
Contributor Author

tjhop commented Aug 18, 2024

There's also this (it made it in during a final refactor but I forgot to update commit description/PR summary):

  1. The normalization of the level key to use lowercase values, since slog's default is uppercase (DEBUG vs debug)

That said, I'll cast my vote:

  1. I can go either way for timestamp key name
  2. No
  3. No
  4. Yes for filepath trimming, maybe for adding in source func on debug level
  5. Yes (purely personal preference)

promlog/log.go Outdated Show resolved Hide resolved
@SuperQ SuperQ requested a review from ArthurSens August 27, 2024 06:44
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm a bit late with the discussions, but my main concern here is why would a Prometheus or prometheus exporter user decide the logging library used underneath 😬

Was there any related discussions that I've missed?

promslog/slog.go Outdated Show resolved Hide resolved
promslog/slog_test.go Outdated Show resolved Hide resolved
promslog/slog_test.go Outdated Show resolved Hide resolved
promslog/slog_test.go Show resolved Hide resolved
@tjhop
Copy link
Contributor Author

tjhop commented Aug 27, 2024

I believe I've addressed all PR feedback, the only remaining item should be determining the approach we want to take on the style initialization, whether we take the constructor approach or advocate consumers use the existing methods when prepping the logger config

@ArthurSens
Copy link
Member

You could use go's type safety to prevent library users from setting weird log styles:

type LogStyle string

const (
	SlogStyle  LogStyle = "slog"
	GoKitStyle LogStyle = "go-kit"
)

// Config is a struct containing configurable settings for the logger
type Config struct {
	Level    *AllowedLevel
	Format   *AllowedFormat
	Style    LogStyle
	ioWriter io.Writer
}

But while quickly trying this out I realized it would require to refactor the whole implementation 😵 . I'm fine with returning error from the constructor

@ArthurSens
Copy link
Member

Hey, I'm creating a new release to unblock the UTF8 work, but I can create another release tomorrow with this PR as well :)

@SuperQ SuperQ requested a review from ArthurSens August 28, 2024 13:46
@ArthurSens
Copy link
Member

Do you also need a new release ASAP to get things done in Prometheus?

@tjhop
Copy link
Contributor Author

tjhop commented Aug 28, 2024

@ArthurSens @SuperQ the last commit adjusts the log style to be a custom type, it's no longer settable 👍

@tjhop
Copy link
Contributor Author

tjhop commented Aug 28, 2024

Do you also need a new release ASAP to get things done in Prometheus?

A release would be helpful whenever y'all are comfortable with the final change set and have time. For now, I'm using go workspaces to start hacking on the prometheus 3.0 conversion 🙃

Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@SuperQ
Copy link
Member

SuperQ commented Aug 28, 2024

@tjhop Do you want to squash up commits and finalize the commit/PR descriptions?

@tjhop
Copy link
Contributor Author

tjhop commented Aug 28, 2024

@tjhop Do you want to squash up commits and finalize the commit/PR descriptions?

no worries, can do 👍

Prereq for prometheus/prometheus#14355

This adds a new `promslog` package to create an opinionated slog logger
for use within the prometheus ecosystem. By default, logs are written at
`info` level and formatted to add a kv pair for the source caller. If
backwards compatibility for the literal output format of the logging is
required, logs can be styled in a format that is similar to how the
`promlog` package formatted it's go-kit/log output [1].  The `promslog`
package also makes use of an `slog.LevelVar` to dynamically adjust the
level of an existing logger. Similar to the old `promlog` package, we
provide means to log in `logfmt` and `json` output formats.

Creating a logger is similar to the old promlog package -- optionally
populate a `Config` struct, and then call `New()` with the config.

In order to dynamically adjust the logger's level, retain the `Config`
struct as it's own variable to access the `AllowedLevel.Set()` method,
which internally updates the `AllowedLevel`'s slog.LevelVar to the
desired log level. Ex:

```go
config := &promslog.Config{} // Retain as variable if you need to dynamically adjust log level
logger := promslog.New(config)
config.Level.Set("debug")
logger.Debug("your message here", "hello", "world")
```

To use go-kit style log output:
```go
config := &promslog.Config{Style: promslog.GoKitStyle} // Retain as variable if you need to dynamically adjust log level
logger := promslog.New(config)
config.Level.Set("debug")
logger.Debug("your message here", "hello", "world")
```

1. When using the `go-kit` log style, the following changes are made to the
default slog output:
- adjusts slog default timestamp key from `timestamp` -> `ts`
- adjusts the timestamp value to use the same time format string
  ("2006-01-02T15:04:05.000Z07:00")
- adjusts slog default sourcecode key from `source` -> `caller`
- adjusts the formatting of the sourcecode values to trim paths with
  `filepath.Base()`. The formatting of the sourcecode value is similar
to the go-kit/log usage, with the addition of the source function in
parenthesis when debug logging is enabled.

Signed-off-by: TJ Hoplock <[email protected]>
@tjhop tjhop changed the title feat: new promslog package to wrap log/slog, deprecate promlog feat: new promslog and promslog/flag packages to wrap log/slog Aug 28, 2024
@tjhop
Copy link
Contributor Author

tjhop commented Aug 28, 2024

Rebased on current upstream main, squashed to a single commit, and updated the commit description/PR summary with some more accurate docs. Lemme know if you have any further thoughts 👍

@ArthurSens
Copy link
Member

Thanks! Merging and doing the release :)

@ArthurSens ArthurSens merged commit 9bbc9cb into prometheus:main Aug 28, 2024
7 checks passed
MrAlias pushed a commit to open-telemetry/opentelemetry-go-contrib that referenced this pull request Aug 29, 2024
…6059)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/prometheus/common](https://togithub.com/prometheus/common)
| `v0.55.0` -> `v0.57.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fprometheus%2fcommon/v0.55.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fcommon/v0.55.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>prometheus/common (github.com/prometheus/common)</summary>

###
[`v0.57.0`](https://togithub.com/prometheus/common/releases/tag/v0.57.0)

[Compare
Source](https://togithub.com/prometheus/common/compare/v0.56.0...v0.57.0)

#### What's Changed

- feat: new promslog and promslog/flag packages to wrap log/slog by
[@&#8203;tjhop](https://togithub.com/tjhop) in
[prometheus/common#677

#### New Contributors

- [@&#8203;tjhop](https://togithub.com/tjhop) made their first
contribution in
[prometheus/common#677

**Full Changelog**:
prometheus/common@v0.56.0...v0.57.0

###
[`v0.56.0`](https://togithub.com/prometheus/common/releases/tag/v0.56.0)

[Compare
Source](https://togithub.com/prometheus/common/compare/v0.55.0...v0.56.0)

#### What's Changed

- Don't always fetch a OAuth2 token, if the secret from a file didn't
change by [@&#8203;multani](https://togithub.com/multani) in
[prometheus/common#647
- remove dependency to github.com/prometheus/client_golang by
[@&#8203;ilius](https://togithub.com/ilius) in
[prometheus/common#662
- Bump github.com/aws/aws-sdk-go from 1.54.7 to 1.54.11 in /sigv4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[prometheus/common#661
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#664
- Revert
[#&#8203;576](https://togithub.com/prometheus/common/issues/576) and add
deprecation notice by [@&#8203;SuperQ](https://togithub.com/SuperQ) in
[prometheus/common#665
- Bump golang.org/x/net from 0.26.0 to 0.27.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[prometheus/common#667
- use basic string in IsValidLegacyMetricName by
[@&#8203;ywwg](https://togithub.com/ywwg) in
[prometheus/common#668
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#672
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#674
- Bump github.com/aws/aws-sdk-go from 1.54.19 to 1.55.5 in /sigv4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[prometheus/common#671
- sigv4: support nil body by
[@&#8203;roidelapluie](https://togithub.com/roidelapluie) in
[prometheus/common#673
- Fix overflows of untyped int constants on 32-bit by
[@&#8203;dswarbrick](https://togithub.com/dswarbrick) in
[prometheus/common#675
- Update client_golang by [@&#8203;SuperQ](https://togithub.com/SuperQ)
in
[prometheus/common#676
- Update golangci lint by
[@&#8203;roidelapluie](https://togithub.com/roidelapluie) in
[prometheus/common#679
- expfmt: Add UTF-8 syntax support in text_parse.go by
[@&#8203;fedetorres93](https://togithub.com/fedetorres93) in
[prometheus/common#670
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#681
- fix(utf8): provide a method for explicitly checking label names for
legacy validity by [@&#8203;ywwg](https://togithub.com/ywwg) in
[prometheus/common#682

#### New Contributors

- [@&#8203;multani](https://togithub.com/multani) made their first
contribution in
[prometheus/common#647
- [@&#8203;ilius](https://togithub.com/ilius) made their first
contribution in
[prometheus/common#662
- [@&#8203;dswarbrick](https://togithub.com/dswarbrick) made their first
contribution in
[prometheus/common#675
- [@&#8203;fedetorres93](https://togithub.com/fedetorres93) made their
first contribution in
[prometheus/common#670

**Full Changelog**:
prometheus/common@v0.55.0...v0.56.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-go-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
MrAlias pushed a commit to open-telemetry/opentelemetry-go that referenced this pull request Aug 29, 2024
…5748)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/prometheus/common](https://togithub.com/prometheus/common)
| `v0.55.0` -> `v0.57.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fprometheus%2fcommon/v0.55.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fcommon/v0.55.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>prometheus/common (github.com/prometheus/common)</summary>

###
[`v0.57.0`](https://togithub.com/prometheus/common/releases/tag/v0.57.0)

[Compare
Source](https://togithub.com/prometheus/common/compare/v0.56.0...v0.57.0)

#### What's Changed

- feat: new promslog and promslog/flag packages to wrap log/slog by
[@&#8203;tjhop](https://togithub.com/tjhop) in
[prometheus/common#677

#### New Contributors

- [@&#8203;tjhop](https://togithub.com/tjhop) made their first
contribution in
[prometheus/common#677

**Full Changelog**:
prometheus/common@v0.56.0...v0.57.0

###
[`v0.56.0`](https://togithub.com/prometheus/common/releases/tag/v0.56.0)

[Compare
Source](https://togithub.com/prometheus/common/compare/v0.55.0...v0.56.0)

#### What's Changed

- Don't always fetch a OAuth2 token, if the secret from a file didn't
change by [@&#8203;multani](https://togithub.com/multani) in
[prometheus/common#647
- remove dependency to github.com/prometheus/client_golang by
[@&#8203;ilius](https://togithub.com/ilius) in
[prometheus/common#662
- Bump github.com/aws/aws-sdk-go from 1.54.7 to 1.54.11 in /sigv4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[prometheus/common#661
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#664
- Revert
[#&#8203;576](https://togithub.com/prometheus/common/issues/576) and add
deprecation notice by [@&#8203;SuperQ](https://togithub.com/SuperQ) in
[prometheus/common#665
- Bump golang.org/x/net from 0.26.0 to 0.27.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[prometheus/common#667
- use basic string in IsValidLegacyMetricName by
[@&#8203;ywwg](https://togithub.com/ywwg) in
[prometheus/common#668
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#672
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#674
- Bump github.com/aws/aws-sdk-go from 1.54.19 to 1.55.5 in /sigv4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[prometheus/common#671
- sigv4: support nil body by
[@&#8203;roidelapluie](https://togithub.com/roidelapluie) in
[prometheus/common#673
- Fix overflows of untyped int constants on 32-bit by
[@&#8203;dswarbrick](https://togithub.com/dswarbrick) in
[prometheus/common#675
- Update client_golang by [@&#8203;SuperQ](https://togithub.com/SuperQ)
in
[prometheus/common#676
- Update golangci lint by
[@&#8203;roidelapluie](https://togithub.com/roidelapluie) in
[prometheus/common#679
- expfmt: Add UTF-8 syntax support in text_parse.go by
[@&#8203;fedetorres93](https://togithub.com/fedetorres93) in
[prometheus/common#670
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/common#681
- fix(utf8): provide a method for explicitly checking label names for
legacy validity by [@&#8203;ywwg](https://togithub.com/ywwg) in
[prometheus/common#682

#### New Contributors

- [@&#8203;multani](https://togithub.com/multani) made their first
contribution in
[prometheus/common#647
- [@&#8203;ilius](https://togithub.com/ilius) made their first
contribution in
[prometheus/common#662
- [@&#8203;dswarbrick](https://togithub.com/dswarbrick) made their first
contribution in
[prometheus/common#675
- [@&#8203;fedetorres93](https://togithub.com/fedetorres93) made their
first contribution in
[prometheus/common#670

**Full Changelog**:
prometheus/common@v0.55.0...v0.56.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
XSAM pushed a commit to XSAM/otelsql that referenced this pull request Aug 29, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/prometheus/common](https://togithub.com/prometheus/common)
| `v0.56.0` -> `v0.57.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fprometheus%2fcommon/v0.56.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fcommon/v0.56.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>prometheus/common (github.com/prometheus/common)</summary>

###
[`v0.57.0`](https://togithub.com/prometheus/common/releases/tag/v0.57.0)

[Compare
Source](https://togithub.com/prometheus/common/compare/v0.56.0...v0.57.0)

#### What's Changed

- feat: new promslog and promslog/flag packages to wrap log/slog by
[@&#8203;tjhop](https://togithub.com/tjhop) in
[prometheus/common#677

#### New Contributors

- [@&#8203;tjhop](https://togithub.com/tjhop) made their first
contribution in
[prometheus/common#677

**Full Changelog**:
prometheus/common@v0.56.0...v0.57.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/XSAM/otelsql).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41Ni4wIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
bogdandrutu pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Sep 4, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/prometheus/common](https://redirect.github.com/prometheus/common)
| `v0.56.0` -> `v0.57.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fprometheus%2fcommon/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fprometheus%2fcommon/v0.56.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fcommon/v0.56.0/v0.57.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>prometheus/common (github.com/prometheus/common)</summary>

###
[`v0.57.0`](https://redirect.github.com/prometheus/common/releases/tag/v0.57.0)

[Compare
Source](https://redirect.github.com/prometheus/common/compare/v0.56.0...v0.57.0)

#### What's Changed

- feat: new promslog and promslog/flag packages to wrap log/slog by
[@&#8203;tjhop](https://redirect.github.com/tjhop) in
[prometheus/common#677

#### New Contributors

- [@&#8203;tjhop](https://redirect.github.com/tjhop) made their first
contribution in
[prometheus/common#677

**Full Changelog**:
prometheus/common@v0.56.0...v0.57.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <[email protected]>
Co-authored-by: Yang Song <[email protected]>
yurishkuro pushed a commit to jaegertracing/jaeger that referenced this pull request Sep 5, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/prometheus/common](https://redirect.github.com/prometheus/common)
| `v0.56.0` -> `v0.58.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fcommon/v0.58.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fprometheus%2fcommon/v0.58.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fprometheus%2fcommon/v0.56.0/v0.58.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fcommon/v0.56.0/v0.58.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>prometheus/common (github.com/prometheus/common)</summary>

###
[`v0.58.0`](https://redirect.github.com/prometheus/common/compare/v0.57.0...v0.58.0)

[Compare
Source](https://redirect.github.com/prometheus/common/compare/v0.57.0...v0.58.0)

###
[`v0.57.0`](https://redirect.github.com/prometheus/common/releases/tag/v0.57.0)

[Compare
Source](https://redirect.github.com/prometheus/common/compare/v0.56.0...v0.57.0)

#### What's Changed

- feat: new promslog and promslog/flag packages to wrap log/slog by
[@&#8203;tjhop](https://redirect.github.com/tjhop) in
[prometheus/common#677

#### New Contributors

- [@&#8203;tjhop](https://redirect.github.com/tjhop) made their first
contribution in
[prometheus/common#677

**Full Changelog**:
prometheus/common@v0.56.0...v0.57.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/jaegertracing/jaeger).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiY2hhbmdlbG9nOmRlcGVuZGVuY2llcyJdfQ==-->

Signed-off-by: Mend Renovate <[email protected]>
// of .999999999 which changes the timestamp from 9 variable to 3 fixed
// decimals (.130 instead of .130987456).
t := a.Value.Time()
a.Value = slog.StringValue(t.Format("2006-01-02T15:04:05.000Z07:00"))
Copy link
Contributor

@dswarbrick dswarbrick Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-UTC timestamp format here differs from the previous promlog (go-kit) timestamp format, which used .UTC().

	timestampFormat = log.TimestampFormat(
		func() time.Time { return time.Now().UTC() },
		"2006-01-02T15:04:05.000Z07:00",
	)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants