-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add nginx receiver * Update CHANGELOG.md Co-authored-by: Curtis Robert <[email protected]> * Update CHANGELOG.md Co-authored-by: Curtis Robert <[email protected]> * make fmt * make tidy * Set a small collection_interval * Add credentials to test configuration * Correct auth info * Fix endpoint * make tidy * make tidy * Correct CHANGELOG.md * Fix typo --------- Co-authored-by: Curtis Robert <[email protected]>
- Loading branch information
Showing
10 changed files
with
150 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright Splunk, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build integration | ||
|
||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" | ||
|
||
"github.com/signalfx/splunk-otel-collector/tests/testutils" | ||
) | ||
|
||
func TestNginxIntegration(t *testing.T) { | ||
testutils.CheckGoldenFile(t, "all_metrics_config.yaml", "all_expected_metrics.yaml", | ||
pmetrictest.IgnoreScopeVersion(), | ||
pmetrictest.IgnoreMetricDataPointsOrder(), | ||
pmetrictest.IgnoreResourceMetricsOrder(), | ||
pmetrictest.IgnoreScopeMetricsOrder(), | ||
pmetrictest.IgnoreMetricsOrder(), | ||
pmetrictest.IgnoreMetricValues(), | ||
pmetrictest.IgnoreTimestamp(), | ||
pmetrictest.IgnoreStartTimestamp(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
resourceMetrics: | ||
- resource: {} | ||
scopeMetrics: | ||
- metrics: | ||
- description: The total number of accepted client connections | ||
name: nginx.connections_accepted | ||
sum: | ||
aggregationTemporality: 2 | ||
dataPoints: | ||
- asInt: "1" | ||
timeUnixNano: "1643729289485220000" | ||
isMonotonic: true | ||
unit: connections | ||
- description: The current number of nginx connections by state | ||
sum: | ||
aggregationTemporality: 2 | ||
dataPoints: | ||
- asInt: "1" | ||
attributes: | ||
- key: state | ||
value: | ||
stringValue: active | ||
timeUnixNano: "1643729289485220000" | ||
- asInt: "0" | ||
attributes: | ||
- key: state | ||
value: | ||
stringValue: reading | ||
timeUnixNano: "1643729289485220000" | ||
- asInt: "1" | ||
attributes: | ||
- key: state | ||
value: | ||
stringValue: writing | ||
timeUnixNano: "1643729289485220000" | ||
- asInt: "0" | ||
attributes: | ||
- key: state | ||
value: | ||
stringValue: waiting | ||
timeUnixNano: "1643729289485220000" | ||
isMonotonic: false | ||
name: nginx.connections_current | ||
unit: connections | ||
- description: The total number of handled connections. Generally, the parameter value is the same as nginx.connections_accepted unless some resource limits have been reached (for example, the worker_connections limit). | ||
name: nginx.connections_handled | ||
sum: | ||
aggregationTemporality: 2 | ||
dataPoints: | ||
- asInt: "1" | ||
timeUnixNano: "1643729289485220000" | ||
isMonotonic: true | ||
unit: connections | ||
- description: Total number of requests made to the server since it started | ||
name: nginx.requests | ||
sum: | ||
aggregationTemporality: 2 | ||
dataPoints: | ||
- asInt: "2" | ||
timeUnixNano: "1643729289485220000" | ||
isMonotonic: true | ||
unit: requests | ||
scope: | ||
name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver | ||
version: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
receivers: | ||
nginx: | ||
endpoint: "http://localhost:8123/nginx_status" | ||
auth: | ||
authenticator: basicauth | ||
collection_interval: 1s | ||
|
||
exporters: | ||
otlp: | ||
endpoint: "${OTLP_ENDPOINT}" | ||
tls: | ||
insecure: true | ||
|
||
extensions: | ||
basicauth: | ||
client_auth: | ||
username: some_user | ||
password: some_password | ||
|
||
service: | ||
telemetry: | ||
logs: | ||
level: "info" | ||
extensions: [ basicauth ] | ||
pipelines: | ||
metrics: | ||
receivers: | ||
- nginx | ||
exporters: | ||
- otlp |