From 6b1023b280a47f2723ebc071fd2e025c438e4cc2 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Mon, 25 Mar 2024 11:19:24 -0700 Subject: [PATCH] Move solr to quay (#4529) * Move solr to quay * move to golden files as well --- .github/workflows/integration-test.yml | 4 + .../server => docker/solr}/Dockerfile | 0 .../collectd-solr/collectd_solr_test.go | 79 +- .../collectd-solr/testdata/all_expected.yaml | 1071 +++++++++++++++++ .../testdata/all_metrics_config.yaml | 10 +- .../testdata/resource_metrics/all.yaml | 61 - 6 files changed, 1151 insertions(+), 74 deletions(-) rename {tests/receivers/smartagent/collectd-solr/testdata/server => docker/solr}/Dockerfile (100%) create mode 100644 tests/receivers/smartagent/collectd-solr/testdata/all_expected.yaml delete mode 100644 tests/receivers/smartagent/collectd-solr/testdata/resource_metrics/all.yaml diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index b5a66489aa..aaaaaf956c 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -225,6 +225,10 @@ jobs: image: quay.io/splunko11ytest/redis_server:latest ports: - "6379:6379" + solr: + image: quay.io/splunko11ytest/solr:latest + ports: + - "8983:8983" mysql: image: quay.io/splunko11ytest/mysql:latest ports: diff --git a/tests/receivers/smartagent/collectd-solr/testdata/server/Dockerfile b/docker/solr/Dockerfile similarity index 100% rename from tests/receivers/smartagent/collectd-solr/testdata/server/Dockerfile rename to docker/solr/Dockerfile diff --git a/tests/receivers/smartagent/collectd-solr/collectd_solr_test.go b/tests/receivers/smartagent/collectd-solr/collectd_solr_test.go index 661016b357..f2b09ad5c3 100644 --- a/tests/receivers/smartagent/collectd-solr/collectd_solr_test.go +++ b/tests/receivers/smartagent/collectd-solr/collectd_solr_test.go @@ -17,22 +17,81 @@ package tests import ( - "path" + "context" + "fmt" + "path/filepath" + "runtime" "testing" + "time" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver/otlpreceiver" + "go.opentelemetry.io/collector/receiver/receivertest" + "go.uber.org/zap" "github.com/signalfx/splunk-otel-collector/tests/testutils" ) func TestCollectdSolrReceiverProvidesAllMetrics(t *testing.T) { - containers := []testutils.Container{ - testutils.NewContainer().WithContext( - path.Join(".", "testdata", "server"), - ).WithExposedPorts("8983:8983").WithName( - "solr", - ).WillWaitForPorts("8983").WillWaitForLogs("Time spent:"), + checkGoldenFile(t, "all_metrics_config.yaml", "all_expected.yaml", + pmetrictest.IgnoreTimestamp(), + pmetrictest.IgnoreMetricValues( + "gauge.solr.core_usablespace", + "counter.solr.node_collections_requests", + "counter.solr.node_metrics_requests", + "counter.solr.http_2xx_responses", + "counter.solr.http_requests", + "gauge.solr.jetty_request_latency", + "gauge.solr.jvm_heap_usage", + "gauge.solr.jvm_total_memory_used", + "gauge.solr.jvm_memory_pools_Metaspace_usage", + ), + ) +} + +func checkGoldenFile(t *testing.T, configFile string, expectedFilePath string, options ...pmetrictest.CompareMetricsOption) { + f := otlpreceiver.NewFactory() + port := testutils.GetAvailablePort(t) + c := f.CreateDefaultConfig().(*otlpreceiver.Config) + c.GRPC.NetAddr.Endpoint = fmt.Sprintf("localhost:%d", port) + sink := &consumertest.MetricsSink{} + receiver, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), c, sink) + require.NoError(t, err) + require.NoError(t, receiver.Start(context.Background(), componenttest.NewNopHost())) + t.Cleanup(func() { + require.NoError(t, receiver.Shutdown(context.Background())) + }) + logger, _ := zap.NewDevelopment() + + dockerHost := "0.0.0.0" + if runtime.GOOS == "darwin" { + dockerHost = "host.docker.internal" } + p, err := testutils.NewCollectorContainer(). + WithConfigPath(filepath.Join("testdata", configFile)). + WithLogger(logger). + WithEnv(map[string]string{"OTLP_ENDPOINT": fmt.Sprintf("%s:%d", dockerHost, port)}). + Build() + require.NoError(t, err) + require.NoError(t, p.Start()) + t.Cleanup(func() { + require.NoError(t, p.Shutdown()) + }) - testutils.AssertAllMetricsReceived( - t, "all.yaml", "all_metrics_config.yaml", containers, nil, - ) + expected, err := golden.ReadMetrics(filepath.Join("testdata", expectedFilePath)) + //require.NoError(t, err) + + assert.EventuallyWithT(t, func(tt *assert.CollectT) { + if len(sink.AllMetrics()) == 0 { + assert.Fail(tt, "No metrics collected") + return + } + err := pmetrictest.CompareMetrics(expected, sink.AllMetrics()[len(sink.AllMetrics())-1], options...) + assert.NoError(tt, err) + }, 10*time.Second, 1*time.Second) } diff --git a/tests/receivers/smartagent/collectd-solr/testdata/all_expected.yaml b/tests/receivers/smartagent/collectd-solr/testdata/all_expected.yaml new file mode 100644 index 0000000000..4b62f37d6a --- /dev/null +++ b/tests/receivers/smartagent/collectd-solr/testdata/all_expected.yaml @@ -0,0 +1,1071 @@ +resourceMetrics: + - resource: {} + scopeMetrics: + - metrics: + - gauge: + dataPoints: + - asInt: "0" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.core_deleted_docs + - gauge: + dataPoints: + - asInt: "32" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.core_max_docs + - gauge: + dataPoints: + - asInt: "32" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.core_num_docs + - gauge: + dataPoints: + - asInt: "6" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.searcher_warmup + - gauge: + dataPoints: + - asInt: "149281173504" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.core_totalspace + - gauge: + dataPoints: + - asInt: "9201172480" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.core_usablespace + - gauge: + dataPoints: + - asInt: "28388" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.core_index_size + - gauge: + dataPoints: + - asInt: "1" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.document_cache_cumulative_hitratio + - gauge: + dataPoints: + - asInt: "1" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.field_value_cache_cumulative_hitratio + - gauge: + dataPoints: + - asInt: "0" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.query_result_cache_cumulative_hitratio + - gauge: + dataPoints: + - asDouble: 48.730375 + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.search_query_response + - name: counter.solr.search_query_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "1" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - gauge: + dataPoints: + - asInt: "0" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.replication_handler_response + - name: counter.solr.replication_handler_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "0" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - gauge: + dataPoints: + - asDouble: 35.91122398996872 + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.update_request_handler_response + - name: counter.solr.update_handler_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "15" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: 172.17.0.3:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.node_collections_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "136" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.node_cores_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "1" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.node_zookeeper_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "0" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.node_metrics_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "64" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.http_2xx_responses + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "218" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.http_4xx_responses + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "0" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.http_5xx_responses + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "0" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - name: counter.solr.http_requests + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "218" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + isMonotonic: true + - gauge: + dataPoints: + - asDouble: 16.155495352758063 + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.jetty_request_latency + - gauge: + dataPoints: + - asDouble: 0.43362680077552795 + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.jvm_heap_usage + - gauge: + dataPoints: + - asInt: "-1" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.jvm_total_memory + - gauge: + dataPoints: + - asInt: "334653232" + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.jvm_total_memory_used + - gauge: + dataPoints: + - asDouble: 0.9906743534041744 + attributes: + - key: cluster + value: + stringValue: default + - key: collection + value: + stringValue: techproducts + - key: core + value: + stringValue: techproducts_shard1_replica_n1 + - key: dsname + value: + stringValue: value + - key: leader + value: + stringValue: "true" + - key: node + value: + stringValue: localhost:8983_solr + - key: plugin + value: + stringValue: solr + - key: plugin_instance + value: + stringValue: localhost:8983 + - key: shard + value: + stringValue: shard1 + - key: system.type + value: + stringValue: solr + timeUnixNano: "1000000" + name: gauge.solr.jvm_memory_pools_Metaspace_usage + scope: {} diff --git a/tests/receivers/smartagent/collectd-solr/testdata/all_metrics_config.yaml b/tests/receivers/smartagent/collectd-solr/testdata/all_metrics_config.yaml index d4f65537ca..20499dfcd3 100644 --- a/tests/receivers/smartagent/collectd-solr/testdata/all_metrics_config.yaml +++ b/tests/receivers/smartagent/collectd-solr/testdata/all_metrics_config.yaml @@ -6,17 +6,21 @@ receivers: extraMetrics: ["*"] intervalSeconds: 1 +processors: + batch: + groupbyattrs: + keys: + - host.name exporters: otlp: endpoint: "${OTLP_ENDPOINT}" tls: insecure: true - debug: - service: pipelines: metrics: receivers: - smartagent/collectd_solr - exporters: [otlp, debug] + processors: [batch, groupbyattrs] + exporters: [otlp] diff --git a/tests/receivers/smartagent/collectd-solr/testdata/resource_metrics/all.yaml b/tests/receivers/smartagent/collectd-solr/testdata/resource_metrics/all.yaml deleted file mode 100644 index b829574353..0000000000 --- a/tests/receivers/smartagent/collectd-solr/testdata/resource_metrics/all.yaml +++ /dev/null @@ -1,61 +0,0 @@ -resource_metrics: - - scope_metrics: - - metrics: - - name: counter.solr.http_2xx_responses - type: IntMonotonicCumulativeSum - - name: counter.solr.http_4xx_responses - type: IntMonotonicCumulativeSum - - name: counter.solr.http_5xx_responses - type: IntMonotonicCumulativeSum - - name: counter.solr.http_requests - type: IntMonotonicCumulativeSum - - name: counter.solr.node_collections_requests - type: IntMonotonicCumulativeSum - - name: counter.solr.node_cores_requests - type: IntMonotonicCumulativeSum - - name: counter.solr.node_metrics_requests - type: IntMonotonicCumulativeSum - - name: counter.solr.node_zookeeper_requests - type: IntMonotonicCumulativeSum - - name: counter.solr.replication_handler_requests - type: IntMonotonicCumulativeSum - - name: counter.solr.search_query_requests - type: IntMonotonicCumulativeSum - - name: counter.solr.update_handler_requests - type: IntMonotonicCumulativeSum - - name: gauge.solr.core_deleted_docs - type: IntGauge - - name: gauge.solr.core_index_size - type: IntGauge - - name: gauge.solr.core_max_docs - type: IntGauge - - name: gauge.solr.core_num_docs - type: IntGauge - - name: gauge.solr.core_totalspace - type: IntGauge - - name: gauge.solr.core_usablespace - type: IntGauge - - name: gauge.solr.document_cache_cumulative_hitratio - type: IntGauge - - name: gauge.solr.field_value_cache_cumulative_hitratio - type: IntGauge - - name: gauge.solr.jetty_request_latency - type: DoubleGauge - - name: gauge.solr.jvm_heap_usage - type: DoubleGauge - - name: gauge.solr.jvm_memory_pools_Metaspace_usage - type: DoubleGauge - - name: gauge.solr.jvm_total_memory - type: IntGauge - - name: gauge.solr.jvm_total_memory_used - type: IntGauge - - name: gauge.solr.query_result_cache_cumulative_hitratio - type: IntGauge - - name: gauge.solr.replication_handler_response - type: IntGauge - - name: gauge.solr.search_query_response - type: DoubleGauge - - name: gauge.solr.searcher_warmup - type: IntGauge - - name: gauge.solr.update_request_handler_response - type: DoubleGauge