[#84] add tracing support #123

Merged
alexvanin merged 1 commit from pogpp/frostfs-s3-gw:feature/add_tracing_support into master 2023-06-06 08:11:26 +00:00
Member

Signed-off-by: Pavel Pogodaev p.pogodaev@yadro.com

Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
pogpp force-pushed feature/add_tracing_support from 0b34b52600 to d19a68e692 2023-06-01 13:24:57 +00:00 Compare
alexvanin reviewed 2023-06-01 13:52:13 +00:00
alexvanin left a comment
Owner

Looks good! Let me try it on my machine.

Looks good! Let me try it on my machine.
api/tracing.go Outdated
@ -0,0 +77,4 @@
ctx = extractHTTPTraceInfo(ctx, r)
opts = append(opts, trace.WithAttributes(
attribute.String("http.client_address", r.RemoteAddr),
attribute.String("http.path", r.Host),
Owner

I suggest to use s3 prefix instead of http. S3 protocol works on top of http anyway, but it would be easier to distinguish from http gateway.

I suggest to use `s3` prefix instead of `http`. S3 protocol works on top of http anyway, but it would be easier to distinguish from http gateway.
alexvanin marked this conversation as resolved
@ -98,6 +98,11 @@ const ( // Settings.
cfgPProfEnabled = "pprof.enabled"
cfgPProfAddress = "pprof.address"
// Tracing ...
Owner

...

...
alexvanin marked this conversation as resolved
@ -67,0 +68,4 @@
enabled: true
exporter: "otlp_grpc"
endpoint: "localhost:4318"
Owner

Update docs/configuration.md

Update `docs/configuration.md`
alexvanin marked this conversation as resolved
dkirillov reviewed 2023-06-01 14:34:51 +00:00
api/tracing.go Outdated
@ -0,0 +73,4 @@
}
// StartHTTPServerSpan starts root HTTP server span.
func StartHTTPServerSpan(ctx context.Context, r *http.Request, operationName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
Member

It seems we can omit explicit ctx contextContext param and use r.Context()

It seems we can omit explicit `ctx contextContext` param and use `r.Context()`
dkirillov marked this conversation as resolved
dkirillov reviewed 2023-06-01 14:36:22 +00:00
api/tracing.go Outdated
@ -0,0 +16,4 @@
return func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
appCtx, span := StartHTTPServerSpan(ctx, r, "REQUEST")
Member

Let's write REQUEST S3 instead of just REQUEST

Let's write `REQUEST S3` instead of just `REQUEST`
dkirillov marked this conversation as resolved
pogpp force-pushed feature/add_tracing_support from d19a68e692 to eb47941cd7 2023-06-01 18:43:20 +00:00 Compare
pogpp force-pushed feature/add_tracing_support from eb47941cd7 to 0b1e4a3d4f 2023-06-02 08:25:40 +00:00 Compare
Member

@pogpp Please run pre-commit run --all and fix issues

@pogpp Please run `pre-commit run --all` and fix issues
pogpp force-pushed feature/add_tracing_support from 0b1e4a3d4f to 547996bc6b 2023-06-02 11:50:43 +00:00 Compare
alexvanin approved these changes 2023-06-02 12:28:28 +00:00
Member

I still have some issues with pre-commit:

$ pre-commit run --all
...
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing docs/authmate.md
Fixing docs/configuration.md
Fixing .forgejo/workflows/tests.yml

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing .forgejo/workflows/tests.yml
I still have some issues with `pre-commit`: ```pre-commit $ pre-commit run --all ... trim trailing whitespace.................................................Failed - hook id: trailing-whitespace - exit code: 1 - files were modified by this hook Fixing docs/authmate.md Fixing docs/configuration.md Fixing .forgejo/workflows/tests.yml fix end of files.........................................................Failed - hook id: end-of-file-fixer - exit code: 1 - files were modified by this hook Fixing .forgejo/workflows/tests.yml ```
pogpp force-pushed feature/add_tracing_support from 547996bc6b to 16fbf3bab0 2023-06-05 07:20:27 +00:00 Compare
alexvanin requested review from storage-services-committers 2023-06-05 07:32:08 +00:00
alexvanin requested review from storage-services-developers 2023-06-05 07:32:08 +00:00
dkirillov reviewed 2023-06-05 07:42:46 +00:00
@ -502,0 +515,4 @@
|-------------|----------|---------------|-----------------------|-----------------------------------------|
| `enabled` | `bool` | yes | `true` | Flag to enable the service. |
| `exporter` | `string` | yes | `otlp_grpc` | Type of tracing exporter. |
| `endpoint` | `string` | yes | `localhost:4318` | Address that service listener binds to. |
Member

Actually, currently there are not default values for tracing.

To be more precise current default values: false, "", ""

Actually, currently there are not default values for tracing. To be more precise current default values: `false`, `""`, `""`
Member

@pogpp It seems your last force push didn't change anything

@pogpp It seems your last force push didn't change anything
pogpp force-pushed feature/add_tracing_support from 253a48cc4b to b1de3b6e77 2023-06-05 10:07:27 +00:00 Compare
pogpp force-pushed feature/add_tracing_support from b1de3b6e77 to 448e550d75 2023-06-05 10:11:23 +00:00 Compare
pogpp force-pushed feature/add_tracing_support from 448e550d75 to 4e1fd9589b 2023-06-06 07:26:18 +00:00 Compare
alexvanin approved these changes 2023-06-06 08:10:21 +00:00
alexvanin merged commit 4e1fd9589b into master 2023-06-06 08:11:26 +00:00
alexvanin deleted branch feature/add_tracing_support 2023-06-06 08:11:27 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#123
No description provided.