-
Notifications
You must be signed in to change notification settings - Fork 536
Only overwrite service.version if service.name is also set #7281
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
Only overwrite service.version if service.name is also set #7281
Conversation
|
This pull request does not have a backport label. Could you fix it @tobiasstadler? 🙏
NOTE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
/test |
|
@axw I fixed the tests. |
|
Since this is some kind of bug fix, should it be back ported to 8.1? |
|
@tobiasstadler we have already frozen 8.1. Although it's arguable a bug fix, I'd prefer that it waits for 8.2. Is it causing any issues for you? |
|
No, 8.2 is fine. |
|
run elasticsearch-ci/docs |
|
Thank You! |
|
testing this was unsuccessful with 772e8c1
package main
import (
"context"
"fmt"
"os"
"time"
"go.elastic.co/apm/v2"
)
func main() {
version := "undefined"
if len(os.Args) > 1 {
version = os.Args[1]
}
name := fmt.Sprintf("apm-server-%s", version)
tracer, err := apm.NewTracer("", "1.0.0")
if err != nil {
panic(err)
}
tx := tracer.StartTransaction("name", "type")
ctx := apm.ContextWithTransaction(context.Background(), tx)
span, ctx := apm.StartSpan(ctx, "name", "type")
span.End()
tx.End()
<-time.After(time.Second)
tracer.Flush(nil)
fmt.Printf("%s: %+v\n", name, tracer.Stats())
}
|
|
@stuartnelson3 I'm not sure that your tests cover Tobias's changes. The changes are related to overriding I've verified this with 8.2.0-BC1, using https://github.com/elastic/apm-server/blob/main/testdata/intake-v2/transactions_spans.ndjson#L2. The first transaction overrides I then modified the document to override Finally, I confirmed that if both |
Motivation/summary
For metricsets the
service.versionis only overwritten if alsoservice.nameis given (see #6407 (comment)). It should be the same for transactions, errors, ...Checklist
apmpackagehave been made)For functional changes, consider:
How to test these changes
Ingest a transaction that only contains a
service.version, but noservice.name