Skip to content

Commit

Permalink
Merge branch 'main' into es-rollover-tlscfg
Browse files Browse the repository at this point in the history
  • Loading branch information
yurishkuro authored Nov 24, 2024
2 parents d2394b4 + f6899b0 commit f8e6fc2
Show file tree
Hide file tree
Showing 40 changed files with 879 additions and 388 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ linters:
# Checks usage of github.com/stretchr/testify.
- testifylint

# Detects the possibility to use variables/constants from the Go standard library.
- usestdlibvars

# TODO consider adding more linters, cf. https://olegk.dev/go-linters-configuration-the-right-version

linters-settings:
Expand Down
6 changes: 6 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ dir: "{{.InterfaceDir}}/mocks/"
mockname: "{{.InterfaceName}}"
filename: "{{.InterfaceName}}.go"
boilerplate-file: .mockery.header.txt

# Flags for future v3 compatibility.
# See https://github.com/vektra/mockery/issues/848
issue-845-fix: true
resolve-type-alias: false

packages:
github.com/jaegertracing/jaeger/cmd/collector/app/sanitizer/cache:
interfaces:
Expand Down
3 changes: 2 additions & 1 deletion Makefile.Protobuf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
# instead of the go_package's declared by the imported protof files.
#

DOCKER=docker
DOCKER_PROTOBUF_VERSION=0.5.0
DOCKER_PROTOBUF=jaegertracing/protobuf:$(DOCKER_PROTOBUF_VERSION)
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${DOCKER_PROTOBUF} --proto_path=${PWD}
PROTOC := ${DOCKER} run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${DOCKER_PROTOBUF} --proto_path=${PWD}

PATCHED_OTEL_PROTO_DIR = proto-gen/.patched-otel-proto

Expand Down
5 changes: 3 additions & 2 deletions cmd/anonymizer/app/anonymizer/anonymizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package anonymizer

import (
"net/http"
"os"
"path/filepath"
"testing"
Expand All @@ -18,7 +19,7 @@ import (

var tags = []model.KeyValue{
model.Bool("error", true),
model.String("http.method", "POST"),
model.String("http.method", http.MethodPost),
model.Bool("foobar", true),
}

Expand Down Expand Up @@ -127,7 +128,7 @@ func TestAnonymizer_SaveMapping(t *testing.T) {
func TestAnonymizer_FilterStandardTags(t *testing.T) {
expected := []model.KeyValue{
model.Bool("error", true),
model.String("http.method", "POST"),
model.String("http.method", http.MethodPost),
}
actual := filterStandardTags(tags)
assert.Equal(t, expected, actual)
Expand Down
3 changes: 2 additions & 1 deletion cmd/anonymizer/app/writer/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package writer

import (
"net/http"
"testing"
"time"

Expand All @@ -15,7 +16,7 @@ import (

var tags = []model.KeyValue{
model.Bool("error", true),
model.String("http.method", "POST"),
model.String("http.method", http.MethodPost),
model.Bool("foobar", true),
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/status/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Command(v *viper.Viper, adminPort int) *cobra.Command {
url := convert(v.GetString(statusHTTPHostPort))
ctx, cx := context.WithTimeout(context.Background(), time.Second)
defer cx()
req, _ := http.NewRequestWithContext(ctx, "GET", url, nil)
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
Expand Down
86 changes: 86 additions & 0 deletions cmd/jaeger/docs/migration/all-in-one-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# ALL-IN-ONE METRICS
### Combined Metrics

| V1 Metric | V1 Labels | V2 Metric | V2 Labels |
|-----------|---------------|-----------|---------------|
| jaeger_query_latency | operation, result | jaeger_query_latency | operation, result |
| jaeger_query_responses | operation | jaeger_query_responses | operation |
| jaeger_query_requests_total | operation, result | jaeger_query_requests_total | operation, result |
| go_gc_duration_seconds | N/A | N/A | N/A |
| go_goroutines | N/A | N/A | N/A |
| go_info | version | N/A | N/A |
| go_memstats_alloc_bytes | N/A | N/A | N/A |
| go_memstats_alloc_bytes_total | N/A | N/A | N/A |
| go_memstats_buck_hash_sys_bytes | N/A | N/A | N/A |
| go_memstats_frees_total | N/A | N/A | N/A |
| go_memstats_gc_sys_bytes | N/A | N/A | N/A |
| go_memstats_heap_alloc_bytes | N/A | N/A | N/A |
| go_memstats_heap_idle_bytes | N/A | N/A | N/A |
| go_memstats_heap_inuse_bytes | N/A | N/A | N/A |
| go_memstats_heap_objects | N/A | N/A | N/A |
| go_memstats_heap_released_bytes | N/A | N/A | N/A |
| go_memstats_heap_sys_bytes | N/A | N/A | N/A |
| go_memstats_last_gc_time_seconds | N/A | N/A | N/A |
| go_memstats_lookups_total | N/A | N/A | N/A |
| go_memstats_mallocs_total | N/A | N/A | N/A |
| go_memstats_mcache_inuse_bytes | N/A | N/A | N/A |
| go_memstats_mcache_sys_bytes | N/A | N/A | N/A |
| go_memstats_mspan_inuse_bytes | N/A | N/A | N/A |
| go_memstats_mspan_sys_bytes | N/A | N/A | N/A |
| go_memstats_next_gc_bytes | N/A | N/A | N/A |
| go_memstats_other_sys_bytes | N/A | N/A | N/A |
| go_memstats_stack_inuse_bytes | N/A | N/A | N/A |
| go_memstats_stack_sys_bytes | N/A | N/A | N/A |
| go_memstats_sys_bytes | N/A | N/A | N/A |
| go_threads | N/A | N/A | N/A |
| jaeger_build_info | build_date, revision, version | N/A | N/A |
| jaeger_collector_batch_size | host | N/A | N/A |
| jaeger_collector_http_request_duration | method, path, status | N/A | N/A |
| jaeger_collector_http_server_errors_total | source, status | N/A | N/A |
| jaeger_collector_http_server_requests_total | type | N/A | N/A |
| jaeger_collector_in_queue_latency | host | N/A | N/A |
| jaeger_collector_queue_capacity | host | N/A | N/A |
| jaeger_collector_queue_length | host | N/A | N/A |
| jaeger_collector_save_latency | host | N/A | N/A |
| jaeger_collector_spans_bytes | host | N/A | N/A |
| jaeger_collector_spans_dropped_total | host | N/A | N/A |
| jaeger_collector_spans_received_total | debug, format, svc, transport | N/A | N/A |
| jaeger_collector_spans_rejected_total | debug, format, svc, transport | N/A | N/A |
| jaeger_collector_spans_saved_by_svc_total | debug, result, svc | N/A | N/A |
| jaeger_collector_spans_serviceNames | host | N/A | N/A |
| jaeger_collector_traces_received_total | debug, format, sampler_type, svc, transport | N/A | N/A |
| jaeger_collector_traces_rejected_total | debug, format, sampler_type, svc, transport | N/A | N/A |
| jaeger_collector_traces_saved_by_svc_total | debug, result, sampler_type, svc | N/A | N/A |
| process_cpu_seconds_total | N/A | N/A | N/A |
| process_max_fds | N/A | N/A | N/A |
| process_open_fds | N/A | N/A | N/A |
| process_resident_memory_bytes | N/A | N/A | N/A |
| process_start_time_seconds | N/A | N/A | N/A |
| process_virtual_memory_bytes | N/A | N/A | N/A |
| process_virtual_memory_max_bytes | N/A | N/A | N/A |
| N/A | N/A | exporter_send_failed_spans | exporter, service_instance_id, service_name, service_version |
| N/A | N/A | exporter_sent_spans | exporter, service_instance_id, service_name, service_version |
| N/A | N/A | process_cpu_seconds | service_instance_id, service_name, service_version |
| N/A | N/A | process_memory_rss | service_instance_id, service_name, service_version |
| N/A | N/A | process_runtime_heap_alloc_bytes | service_instance_id, service_name, service_version |
| N/A | N/A | process_runtime_total_alloc_bytes | service_instance_id, service_name, service_version |
| N/A | N/A | process_runtime_total_sys_memory_bytes | service_instance_id, service_name, service_version |
| N/A | N/A | process_uptime | service_instance_id, service_name, service_version |
| N/A | N/A | processor_batch_batch_send_size | processor, service_instance_id, service_name, service_version |
| N/A | N/A | processor_batch_batch_send_size_bytes | processor, service_instance_id, service_name, service_version |
| N/A | N/A | processor_batch_metadata_cardinality | processor, service_instance_id, service_name, service_version |
| N/A | N/A | processor_batch_timeout_trigger_send | processor, service_instance_id, service_name, service_version |
| N/A | N/A | receiver_accepted_spans | receiver, service_instance_id, service_name, service_version, transport |
| N/A | N/A | receiver_refused_spans | receiver, service_instance_id, service_name, service_version, transport |
| N/A | N/A | rpc_server_duration | rpc_grpc_status_code, rpc_method, rpc_service, rpc_system, service_instance_id, service_name, service_version |
| N/A | N/A | rpc_server_request_size | rpc_method, rpc_service, rpc_system, service_instance_id, service_name, service_version |
| N/A | N/A | rpc_server_requests_per_rpc | rpc_grpc_status_code, rpc_method, rpc_service, rpc_system, service_instance_id, service_name, service_version |
| N/A | N/A | rpc_server_response_size | rpc_method, rpc_service, rpc_system, service_instance_id, service_name, service_version |
| N/A | N/A | rpc_server_responses_per_rpc | rpc_grpc_status_code, rpc_method, rpc_service, rpc_system, service_instance_id, service_name, service_version |
| N/A | N/A | target_info | service_instance_id, service_name, service_version |
### Equivalent Metrics

| V1 Metric | V1 Labels | V2 Metric | V2 Labels |
|-----------|---------------|-----------|---------------|
| jaeger_collector_spans_rejected_total | debug, format, svc, transport | receiver_refused_spans | receiver, service_instance_id, service_name, service_version, transport |
| jaeger_build_info | build_date, revision, version | target_info | service_instance_id, service_name, service_version |
33 changes: 33 additions & 0 deletions cmd/jaeger/docs/migration/badger-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# BADGER METRICS

### Combined Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
| ------------------------------------------ | ------------- | ---------------------------------------- | ------------- |
| jaeger_badger_compaction_current_num_lsm | N/A | jaeger_badger_compaction_current_num_lsm | N/A |
| jaeger_badger_get_num_memtable | N/A | jaeger_badger_get_num_memtable | N/A |
| jaeger_badger_get_num_user | N/A | jaeger_badger_get_num_user | N/A |
| jaeger_badger_get_with_result_num_user | N/A | jaeger_badger_get_with_result_num_user | N/A |
| jaeger_badger_iterator_num_user | N/A | jaeger_badger_iterator_num_user | N/A |
| jaeger_badger_put_num_user | N/A | jaeger_badger_put_num_user | N/A |
| jaeger_badger_read_bytes_lsm | N/A | jaeger_badger_read_bytes_lsm | N/A |
| jaeger_badger_read_bytes_vlog | N/A | jaeger_badger_read_bytes_vlog | N/A |
| jaeger_badger_read_num_vlog | N/A | jaeger_badger_read_num_vlog | N/A |
| jaeger_badger_size_bytes_lsm | N/A | jaeger_badger_size_bytes_lsm | N/A |
| jaeger_badger_size_bytes_vlog | N/A | jaeger_badger_size_bytes_vlog | N/A |
| jaeger_badger_write_bytes_l0 | N/A | jaeger_badger_write_bytes_l0 | N/A |
| jaeger_badger_write_bytes_user | N/A | jaeger_badger_write_bytes_user | N/A |
| jaeger_badger_write_bytes_vlog | N/A | jaeger_badger_write_bytes_vlog | N/A |
| jaeger_badger_write_num_vlog | N/A | jaeger_badger_write_num_vlog | N/A |
| jaeger_badger_write_pending_num_memtable | N/A | jaeger_badger_write_pending_num_memtable | N/A |
| jaeger_badger_key_log_bytes_available | N/A | N/A | N/A |
| jaeger_badger_storage_maintenance_last_run | N/A | N/A | N/A |
| jaeger_badger_storage_valueloggc_last_run | N/A | N/A | N/A |
| jaeger_badger_value_log_bytes_available | N/A | N/A | N/A |

### Equivalent Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
| ------------------------------------- | ------------------------------ | ---------------------- | ----------------------------------------------------------------------- |
| jaeger_collector_spans_rejected_total | debug, format, svc, transport | receiver_refused_spans | receiver, service_instance_id, service_name, service_version, transport |
| jaeger_build_info | build_date, revision, version | target_info | service_instance_id, service_name, service_version |
22 changes: 22 additions & 0 deletions cmd/jaeger/docs/migration/cassandra-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# CASSANDRA METRICS
### Combined Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
|-----------|---------------|-----------|---------------|
| jaeger_cassandra_attempts_total | table | jaeger_cassandra_attempts_total | table |
| jaeger_cassandra_errors_total | table | jaeger_cassandra_errors_total | table |
| jaeger_cassandra_inserts_total | table | jaeger_cassandra_inserts_total | table |
| jaeger_cassandra_latency_err | table | jaeger_cassandra_latency_err | table |
| jaeger_cassandra_latency_ok | table | jaeger_cassandra_latency_ok | table |
| jaeger_cassandra_read_attempts_total | table | jaeger_cassandra_read_attempts_total | table |
| jaeger_cassandra_read_errors_total | table | jaeger_cassandra_read_errors_total | table |
| jaeger_cassandra_read_inserts_total | table | jaeger_cassandra_read_inserts_total | table |
| jaeger_cassandra_read_latency_err | table | jaeger_cassandra_read_latency_err | table |
| jaeger_cassandra_read_latency_ok | table | jaeger_cassandra_read_latency_ok | table |
| jaeger_cassandra_tag_index_skipped_total | N/A | jaeger_cassandra_tag_index_skipped_total | N/A |
### Equivalent Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
|-----------|---------------|-----------|---------------|
| jaeger_collector_spans_rejected_total | debug, format, svc, transport | receiver_refused_spans | receiver, service_instance_id, service_name, service_version, transport |
| jaeger_build_info | build_date, revision, version | target_info | service_instance_id, service_name, service_version |
21 changes: 21 additions & 0 deletions cmd/jaeger/docs/migration/elasticsearch-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ELASTICSEARCH METRICS
### Combined Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
|-----------|---------------|-----------|---------------|
| jaeger_bulk_index_attempts_total | N/A | jaeger_bulk_index_attempts_total | N/A |
| jaeger_bulk_index_errors_total | N/A | jaeger_bulk_index_errors_total | N/A |
| jaeger_bulk_index_inserts_total | N/A | jaeger_bulk_index_inserts_total | N/A |
| jaeger_bulk_index_latency_err | N/A | jaeger_bulk_index_latency_err | N/A |
| jaeger_bulk_index_latency_ok | N/A | jaeger_bulk_index_latency_ok | N/A |
| jaeger_index_create_attempts_total | N/A | jaeger_index_create_attempts_total | N/A |
| jaeger_index_create_errors_total | N/A | jaeger_index_create_errors_total | N/A |
| jaeger_index_create_inserts_total | N/A | jaeger_index_create_inserts_total | N/A |
| jaeger_index_create_latency_err | N/A | jaeger_index_create_latency_err | N/A |
| jaeger_index_create_latency_ok | N/A | jaeger_index_create_latency_ok | N/A |
### Equivalent Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
|-----------|---------------|-----------|---------------|
| jaeger_collector_spans_rejected_total | debug, format, svc, transport | receiver_refused_spans | receiver, service_instance_id, service_name, service_version, transport |
| jaeger_build_info | build_date, revision, version | target_info | service_instance_id, service_name, service_version |
21 changes: 21 additions & 0 deletions cmd/jaeger/docs/migration/opensearch-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# OPENSEARCH METRICS
### Combined Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
|-----------|---------------|-----------|---------------|
| jaeger_bulk_index_attempts_total | N/A | jaeger_bulk_index_attempts_total | N/A |
| jaeger_bulk_index_errors_total | N/A | jaeger_bulk_index_errors_total | N/A |
| jaeger_bulk_index_inserts_total | N/A | jaeger_bulk_index_inserts_total | N/A |
| jaeger_bulk_index_latency_err | N/A | jaeger_bulk_index_latency_err | N/A |
| jaeger_bulk_index_latency_ok | N/A | jaeger_bulk_index_latency_ok | N/A |
| jaeger_index_create_attempts_total | N/A | jaeger_index_create_attempts_total | N/A |
| jaeger_index_create_errors_total | N/A | jaeger_index_create_errors_total | N/A |
| jaeger_index_create_inserts_total | N/A | jaeger_index_create_inserts_total | N/A |
| jaeger_index_create_latency_err | N/A | jaeger_index_create_latency_err | N/A |
| jaeger_index_create_latency_ok | N/A | jaeger_index_create_latency_ok | N/A |
### Equivalent Metrics

| V1 Metric | V1 Parameters | V2 Metric | V2 Parameters |
|-----------|---------------|-----------|---------------|
| jaeger_collector_spans_rejected_total | debug, format, svc, transport | receiver_refused_spans | receiver, service_instance_id, service_name, service_version, transport |
| jaeger_build_info | build_date, revision, version | target_info | service_instance_id, service_name, service_version |
16 changes: 1 addition & 15 deletions cmd/query/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,6 @@ func createHTTPServer(
staticHandlerCloser: staticHandlerCloser,
}

// TODO why doesn't OTEL helper do that already?
if queryOpts.HTTP.TLSSetting != nil {
tlsCfg, err := queryOpts.HTTP.TLSSetting.LoadTLSConfig(ctx) // This checks if the certificates are correctly provided
if err != nil {
return nil, errors.Join(err, staticHandlerCloser.Close())
}
server.TLSConfig = tlsCfg
}

return server, nil
}

Expand Down Expand Up @@ -327,12 +318,7 @@ func (s *Server) Start(ctx context.Context) error {
go func() {
defer s.bgFinished.Done()
s.Logger.Info("Starting HTTP server", zap.Int("port", httpPort), zap.String("addr", s.queryOptions.HTTP.Endpoint))
var err error
if s.queryOptions.HTTP.TLSSetting != nil {
err = s.httpServer.ServeTLS(s.httpConn, "", "")
} else {
err = s.httpServer.Serve(s.httpConn)
}
err := s.httpServer.Serve(s.httpConn)
if err != nil && !errors.Is(err, http.ErrServerClosed) && !errors.Is(err, cmux.ErrListenerClosed) && !errors.Is(err, cmux.ErrServerClosed) {
s.Logger.Error("Could not start HTTP server", zap.Error(err))
s.ReportStatus(componentstatus.NewFatalErrorEvent(err))
Expand Down
Loading

0 comments on commit f8e6fc2

Please sign in to comment.