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

added experimental package spans with abstract layer for tracing #1509

Merged
merged 9 commits into from
Oct 21, 2024

Conversation

asmyasnikov
Copy link
Member

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

@asmyasnikov asmyasnikov self-assigned this Oct 14, 2024
@asmyasnikov asmyasnikov changed the title MVP: otel interfaces and driver trace implementation MVP: traing abstract layer and driver trace implementation Oct 14, 2024
@asmyasnikov asmyasnikov changed the title MVP: traing abstract layer and driver trace implementation MVP: tracing abstract layer and driver trace implementation Oct 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 52.48042% with 546 lines in your changes missing coverage. Please review.

Project coverage is 70.80%. Comparing base (1bcbc91) to head (ebc4907).

Files with missing lines Patch % Lines
log/topic.go 48.55% 160 Missing ⚠️
log/table.go 46.77% 99 Missing ⚠️
log/sql.go 0.00% 67 Missing ⚠️
internal/kv/field.go 73.12% 50 Missing and 11 partials ⚠️
log/query.go 59.05% 52 Missing ⚠️
log/driver.go 58.19% 51 Missing ⚠️
log/scripting.go 0.00% 24 Missing ⚠️
log/coordination.go 55.76% 23 Missing ⚠️
log/discovery.go 30.76% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1509      +/-   ##
==========================================
- Coverage   70.95%   70.80%   -0.16%     
==========================================
  Files         355      356       +1     
  Lines       37179    37180       +1     
==========================================
- Hits        26382    26325      -57     
- Misses       9701     9746      +45     
- Partials     1096     1109      +13     
Flag Coverage Δ
experiment 70.66% <52.48%> (-0.14%) ⬇️
go-1.21.x 70.23% <52.48%> (-0.19%) ⬇️
go-1.22.x 68.30% <52.48%> (-0.19%) ⬇️
go-1.23.x 70.75% <52.48%> (-0.13%) ⬇️
integration 52.09% <48.65%> (-0.19%) ⬇️
macOS 41.03% <13.22%> (-0.01%) ⬇️
ubuntu 70.80% <52.48%> (-0.16%) ⬇️
unit 41.04% <13.22%> (-0.01%) ⬇️
windows 41.01% <13.22%> (-0.04%) ⬇️
ydb-23.3 47.67% <42.12%> (-0.23%) ⬇️
ydb-24.1 51.88% <48.65%> (-0.27%) ⬇️
ydb-24.2 51.95% <48.65%> (-0.25%) ⬇️
ydb-nightly 70.66% <52.48%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Oct 14, 2024

github.com/ydb-platform/ydb-go-sdk/v3/log

incompatible changes

(*defaultLogger).Log: changed from func(context.Context, string, ...Field) to func(context.Context, string, ...github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.KeyValue)
Any: removed
AnyType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
Bool: removed
BoolType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
Duration: removed
DurationType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
Error: removed
ErrorType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
Field: changed from Field to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.KeyValue
FieldType: removed
Int64: removed
Int64Type: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
Int: removed
IntType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
InvalidType: removed
Logger.Log: changed from func(context.Context, string, ...Field) to func(context.Context, string, ...github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.KeyValue)
NamedError: removed
String: removed
StringType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
Stringer: removed
StringerType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType
Strings: removed
StringsType: changed from FieldType to github.com/ydb-platform/ydb-go-sdk/v3/internal/kv.FieldType

github.com/ydb-platform/ydb-go-sdk/v3/spans

compatible changes

package added

github.com/ydb-platform/ydb-go-sdk/v3/trace

incompatible changes

DriverOnBalancerClusterDiscoveryAttempt: changed from func(*Driver, *context.Context, call, string) func(error) to func(*Driver, *context.Context, call, string, string) func(error)
DriverOnBalancerUpdate: changed from func(*Driver, *context.Context, call, bool) func(endpoints []EndpointInfo, added []EndpointInfo, dropped []EndpointInfo, localDC string) to func(*Driver, *context.Context, call, bool, string) func(endpoints []EndpointInfo, added []EndpointInfo, dropped []EndpointInfo, localDC string)

compatible changes

DriverBalancerClusterDiscoveryAttemptStartInfo.Database: added
DriverBalancerUpdateStartInfo.Database: added

summary

Base version: v3.84.2-0.20241017174807-1bcbc910b99e (master)
Cannot suggest a release version.
Can only suggest a release version when compared against the most recent version of this major: v3.84.1.

@asmyasnikov asmyasnikov changed the title MVP: tracing abstract layer and driver trace implementation added package otel with abstract layer for tracing Oct 14, 2024
Copy link

github-actions bot commented Oct 14, 2024

🌋 Here are results of SLO test for Go SDK xorm:

Grafana Dashboard

SLO-xorm

Copy link

github-actions bot commented Oct 14, 2024

🌋 Here are results of SLO test for Go SDK database/sql:

Grafana Dashboard

SLO-database-sql

Copy link

github-actions bot commented Oct 14, 2024

🌋 Here are results of SLO test for Go SDK gorm:

Grafana Dashboard

SLO-gorm

Copy link

github-actions bot commented Oct 14, 2024

🌋 Here are results of SLO test for Native ydb-go-sdk/v3 over query-service:

Grafana Dashboard

SLO-native-query

Copy link

github-actions bot commented Oct 14, 2024

🌋 Here are results of SLO test for Native ydb-go-sdk/v3 over table-service:

Grafana Dashboard

SLO-native-table

cfg,
info.Context,
info.Call.FunctionID(),
kv.String("address", info.Address),
Copy link
Member

Choose a reason for hiding this comment

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

Есть соглашение о наименовании https://opentelemetry.io/docs/specs/semconv/. Можно глянуть на примеры ключей и как они формируются.

Comment on lines 15 to 16
kv.String("address", info.Address),
kv.String("database", info.Database),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
kv.String("address", info.Address),
kv.String("database", info.Database),
kv.String("ydb.address", info.Address),
kv.String("ydb.database", info.Database),

otel/discovery.go Outdated Show resolved Hide resolved
otel/retry.go Outdated
cfg,
info.Context,
operationName,
kv.Bool("idempotent", info.Idempotent),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
kv.Bool("idempotent", info.Idempotent),
kv.Bool("ydb.retry.idempotent", info.Idempotent),

otel/retry.go Outdated

return func(info trace.RetryLoopDoneInfo) {
fields := []KeyValue{
kv.Int("attempts", info.Attempts),
Copy link
Member

Choose a reason for hiding this comment

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

Как и раньше, в атрибуты лучше добавлять существенную информацию для фильтрации, быстрого поиска. А attempts - это можно в метрики вынести, чтобы следить за кол-во попыток и словить аномальное поведение.

cfg,
info.Context,
info.Call.FunctionID(),
kv.String("query", info.Query),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
kv.String("query", info.Query),
kv.String("ydb.query", info.Query),

otel/scripting.go Outdated Show resolved Hide resolved
otel/scripting.go Outdated Show resolved Hide resolved
otel/scripting.go Outdated Show resolved Hide resolved
@asmyasnikov asmyasnikov changed the title added package otel with abstract layer for tracing added package spans with abstract layer for tracing Oct 21, 2024
@asmyasnikov asmyasnikov changed the title added package spans with abstract layer for tracing added experimental package spans with abstract layer for tracing Oct 21, 2024
@asmyasnikov asmyasnikov merged commit ff29c05 into master Oct 21, 2024
43 of 44 checks passed
@asmyasnikov asmyasnikov deleted the otel branch October 21, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants