Skip to content

Commit 06ab133

Browse files
committed
New httpcheck OTel package
1 parent 4fc1164 commit 06ab133

File tree

12 files changed

+469
-0
lines changed

12 files changed

+469
-0
lines changed

packages/httpcheck/LICENSE.txt

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Elastic License 2.0
2+
3+
URL: https://www.elastic.co/licensing/elastic-license
4+
5+
## Acceptance
6+
7+
By using the software, you agree to all of the terms and conditions below.
8+
9+
## Copyright License
10+
11+
The licensor grants you a non-exclusive, royalty-free, worldwide,
12+
non-sublicensable, non-transferable license to use, copy, distribute, make
13+
available, and prepare derivative works of the software, in each case subject to
14+
the limitations and conditions below.
15+
16+
## Limitations
17+
18+
You may not provide the software to third parties as a hosted or managed
19+
service, where the service provides users with access to any substantial set of
20+
the features or functionality of the software.
21+
22+
You may not move, change, disable, or circumvent the license key functionality
23+
in the software, and you may not remove or obscure any functionality in the
24+
software that is protected by the license key.
25+
26+
You may not alter, remove, or obscure any licensing, copyright, or other notices
27+
of the licensor in the software. Any use of the licensor’s trademarks is subject
28+
to applicable law.
29+
30+
## Patents
31+
32+
The licensor grants you a license, under any patent claims the licensor can
33+
license, or becomes able to license, to make, have made, use, sell, offer for
34+
sale, import and have imported the software, in each case subject to the
35+
limitations and conditions in this license. This license does not cover any
36+
patent claims that you cause to be infringed by modifications or additions to
37+
the software. If you or your company make any written claim that the software
38+
infringes or contributes to infringement of any patent, your patent license for
39+
the software granted under these terms ends immediately. If your company makes
40+
such a claim, your patent license ends immediately for work on behalf of your
41+
company.
42+
43+
## Notices
44+
45+
You must ensure that anyone who gets a copy of any part of the software from you
46+
also gets a copy of these terms.
47+
48+
If you modify the software, you must include in any modified copies of the
49+
software prominent notices stating that you have modified the software.
50+
51+
## No Other Rights
52+
53+
These terms do not imply any licenses other than those expressly granted in
54+
these terms.
55+
56+
## Termination
57+
58+
If you use the software in violation of these terms, such use is not licensed,
59+
and your licenses will automatically terminate. If the licensor provides you
60+
with a notice of your violation, and you cease all violation of this license no
61+
later than 30 days after you receive that notice, your licenses will be
62+
reinstated retroactively. However, if you violate these terms after such
63+
reinstatement, any additional violation of these terms will cause your licenses
64+
to terminate automatically and permanently.
65+
66+
## No Liability
67+
68+
*As far as the law allows, the software comes as is, without any warranty or
69+
condition, and the licensor will not be liable to you for any damages arising
70+
out of these terms or the use or nature of the software, under any kind of
71+
legal claim.*
72+
73+
## Definitions
74+
75+
The **licensor** is the entity offering these terms, and the **software** is the
76+
software the licensor makes available under these terms, including any portion
77+
of it.
78+
79+
**you** refers to the individual or entity agreeing to these terms.
80+
81+
**your company** is any legal entity, sole proprietorship, or other kind of
82+
organization that you work for, plus all organizations that have control over,
83+
are under the control of, or are under common control with that
84+
organization. **control** means ownership of substantially all the assets of an
85+
entity, or the power to direct its management and policies by vote, contract, or
86+
otherwise. Control can be direct or indirect.
87+
88+
**your licenses** are all the licenses granted to you for the software under
89+
these terms.
90+
91+
**use** means anything you do with the software requiring one of your licenses.
92+
93+
**trademark** means trademarks, service marks, and similar rights.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{{- generatedHeader }}
2+
{{/*
3+
This template can be used as a starting point for writing documentation for your new integration. For each section, fill in the details
4+
described in the comments.
5+
6+
Find more detailed documentation guidelines in https://www.elastic.co/docs/extend/integrations/documentation-guidelines
7+
*/}}
8+
# HTTP Check Integration for Elastic
9+
10+
## Overview
11+
{{/* Complete this section with a short summary of what data this integration collects and what use cases it enables */}}
12+
The HTTP Check integration for Elastic performs HTTP checks using the [HTTP check
13+
receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/httpcheckreceiver/README.md) of the OTel Collector.
14+
15+
This integration can be used to monitor the availability of HTTP endpoints.
16+
17+
### How it works
18+
{{/* Add a high level overview on how this integration works. For example, does it collect data from API calls or recieving data from a network or file.*/}}
19+
This integration performs periodic HTTP checks to the configured endpoints.
20+
21+
Apart from the endpoints, it is also possible to select the HTTP method and
22+
headers to use in the requests.
23+
24+
## What data does this integration collect?
25+
{{/* Complete this section with information on what types of data the integration collects, and link to reference documentation if available */}}
26+
This integration collects metrics with information about the
27+
availability of the HTTP endpoints, and the status codes returned by requests.
28+
29+
Key metrics are stored under the metrics object, and they include:
30+
| Metric Name | Description | Type |
31+
|-------------|-------------|------|
32+
| httpcheck.status | For each status class (1xx, 2xx, 3xx, 4xx or 5xx), it is set to 1 if the check returned an status of this class, to 0 otherwise. | Gauge |
33+
| httpcheck.duration | Total duration of the request in milliseconds. | Gauge |
34+
35+
Documents for these metrics include attributes that follow [Semantic Conventions
36+
for HTTP data](https://opentelemetry.io/docs/specs/semconv/http/).
37+
38+
### Supported use cases
39+
{{/* Add details on the use cases that can be enabled by using this integration. Explain why a user would want to install and use this integration. */}}
40+
This integration can be used to monitor the availability of HTTP endpoints. In a
41+
more general sense, it can be used to perform requests to specific endpoints.
42+
43+
## How do I deploy this integration?
44+
45+
### Agent-based deployment
46+
47+
Elastic Agent must be installed. For more details, check the Elastic Agent [installation instructions](docs-content://reference/fleet/install-elastic-agents.md). You can install only one Elastic Agent per host.
48+
49+
Elastic Agent is required to have network connectivity with the monitored
50+
endpoints.
51+
52+
{{/* If agentless is available for this integration, we'll want to include that here as well.
53+
### Agentless deployment
54+
55+
Agentless deployments are only supported in Elastic Serverless and Elastic Cloud environments. Agentless deployments provide a means to ingest data while avoiding the orchestration, management, and maintenance needs associated with standard ingest infrastructure. Using an agentless deployment makes manual agent deployment unnecessary, allowing you to focus on your data instead of the agent that collects it.
56+
57+
For more information, refer to [Agentless integrations](https://www.elastic.co/guide/en/serverless/current/security-agentless-integrations.html) and [Agentless integrations FAQ](https://www.elastic.co/guide/en/serverless/current/agentless-integration-troubleshooting.html)
58+
*/}}
59+
60+
### Onboard / configure
61+
{{/* List the steps that will need to be followed in order to completely set up a working integration.
62+
For integrations that support multiple input types, be sure to add steps for all inputs.
63+
*/}}
64+
This integration needs to be configured with the list of endpoints to monitor,
65+
and the HTTP method and headers that should be used on the requests.
66+
67+
With each policy you can monitor multiple endpoints that require the same method
68+
and headers. For example you can use a single policy to monitor multiple
69+
endpoints if you only need to check its availability with the `GET` method.
70+
71+
In cases where different headers or methods are required, multiple policies must
72+
be created, one for each combination of configurations.
73+
74+
### Validation
75+
{{/* How can the user test whether the integration is working? Including example commands or test files if applicable */}}
76+
Once configured, you can find documents with information about the status code
77+
of the requests done to the configured endpoints.
78+
79+
## Troubleshooting
80+
81+
For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems).
82+
{{/*
83+
Add any vendor specific troubleshooting here.
84+
85+
Are there common issues or “gotchas” for deploying this integration? If so, how can they be resolved?
86+
If applicable, links to the third-party software’s troubleshooting documentation.
87+
*/}}
88+
89+
## Scaling
90+
91+
For more information on architectures that can be used for scaling this integration, check the [Ingest Architectures](https://www.elastic.co/docs/manage-data/ingest/ingest-reference-architectures) documentation.
92+
{{/* Add any vendor specific scaling information here */}}
93+
94+
## Reference
95+
96+
### Inputs used
97+
98+
This package uses the [HTTP Check Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/httpcheckreceiver/README.md) of the OTel collector.
99+
100+
{{/* All inputs used by this package will be automatically listed here. */}}
101+
{{ inputDocs }}
102+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '2.3'
2+
services:
3+
web:
4+
image: nginx:1.29.0-alpine-slim
5+
ports:
6+
- 80
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
connectors:
2+
forward: {}
3+
exporters:
4+
elasticsearch/componentid-0:
5+
endpoints:
6+
- https://elasticsearch:9200
7+
inputs: []
8+
output_permissions:
9+
default:
10+
_elastic_agent_checks:
11+
cluster:
12+
- monitor
13+
_elastic_agent_monitoring:
14+
indices: []
15+
uuid-for-permissions-on-related-indices:
16+
indices:
17+
- names:
18+
- metrics-*-*
19+
privileges:
20+
- auto_configure
21+
- create_doc
22+
processors:
23+
transform/componentid-0:
24+
metric_statements:
25+
- context: datapoint
26+
statements:
27+
- set(attributes["data_stream.type"], "metrics")
28+
- set(attributes["data_stream.dataset"], "httpcheck.httpcheckreceiver")
29+
- set(attributes["data_stream.namespace"], "ep")
30+
receivers:
31+
httpcheck/componentid-0:
32+
collection_interval: 1m
33+
targets:
34+
- endpoints:
35+
- https://epr.elastic.co
36+
method: GET
37+
secret_references: []
38+
service:
39+
pipelines:
40+
metrics:
41+
exporters:
42+
- elasticsearch/componentid-0
43+
receivers:
44+
- forward
45+
metrics/componentid-0:
46+
exporters:
47+
- forward
48+
processors:
49+
- transform/componentid-0
50+
receivers:
51+
- httpcheck/componentid-0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vars:
2+
endpoints:
3+
- https://epr.elastic.co
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
service: web
2+
vars:
3+
period: 1s
4+
endpoints:
5+
- http://{{Hostname}}:{{Port}}
6+
assert:
7+
min_count: 50
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
receivers:
2+
httpcheck:
3+
collection_interval: {{period}}
4+
targets:
5+
- method: {{method}}
6+
endpoints:
7+
{{#each endpoints}}
8+
- {{this}}
9+
{{/each}}
10+
{{#if headers }}
11+
headers:
12+
{{#each headers}}
13+
{{this}}
14+
{{/each}}
15+
{{/if}}
16+
17+
service:
18+
pipelines:
19+
metrics:
20+
receivers: [httpcheck]

packages/httpcheck/changelog.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# newer versions go on top
2+
- version: "0.1.0"
3+
changes:
4+
- description: Initial version of the package
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/1 # FIXME Replace with the real PR link

packages/httpcheck/docs/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!-- NOTICE: Do not edit this file manually.-->
2+
<!-- This file is automatically generated by Elastic Package -->
3+
4+
# HTTP Check Integration for Elastic
5+
6+
## Overview
7+
8+
The HTTP Check integration for Elastic performs HTTP checks using the [HTTP check
9+
receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/httpcheckreceiver/README.md) of the OTel Collector.
10+
11+
This integration can be used to monitor the availability of HTTP endpoints.
12+
13+
### How it works
14+
15+
This integration performs periodic HTTP checks to the configured endpoints.
16+
17+
Apart from the endpoints, it is also possible to select the HTTP method and
18+
headers to use in the requests.
19+
20+
## What data does this integration collect?
21+
22+
This integration collects metrics with information about the
23+
availability of the HTTP endpoints, and the status codes returned by requests.
24+
25+
Key metrics are stored under the metrics object, and they include:
26+
| Metric Name | Description | Type |
27+
|-------------|-------------|------|
28+
| httpcheck.status | For each status class (1xx, 2xx, 3xx, 4xx or 5xx), it is set to 1 if the check returned an status of this class, to 0 otherwise. | Gauge |
29+
| httpcheck.duration | Total duration of the request in milliseconds. | Gauge |
30+
31+
Documents for these metrics include attributes that follow [Semantic Conventions
32+
for HTTP data](https://opentelemetry.io/docs/specs/semconv/http/).
33+
34+
### Supported use cases
35+
36+
This integration can be used to monitor the availability of HTTP endpoints. In a
37+
more general sense, it can be used to perform requests to specific endpoints.
38+
39+
## How do I deploy this integration?
40+
41+
### Agent-based deployment
42+
43+
Elastic Agent must be installed. For more details, check the Elastic Agent [installation instructions](docs-content://reference/fleet/install-elastic-agents.md). You can install only one Elastic Agent per host.
44+
45+
Elastic Agent is required to have network connectivity with the monitored
46+
endpoints.
47+
48+
49+
50+
### Onboard / configure
51+
52+
This integration needs to be configured with the list of endpoints to monitor,
53+
and the HTTP method and headers that should be used on the requests.
54+
55+
With each policy you can monitor multiple endpoints that require the same method
56+
and headers. For example you can use a single policy to monitor multiple
57+
endpoints if you only need to check its availability with the `GET` method.
58+
59+
In cases where different headers or methods are required, multiple policies must
60+
be created, one for each combination of configurations.
61+
62+
### Validation
63+
64+
Once configured, you can find documents with information about the status code
65+
of the requests done to the configured endpoints.
66+
67+
## Troubleshooting
68+
69+
For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems).
70+
71+
72+
## Scaling
73+
74+
For more information on architectures that can be used for scaling this integration, check the [Ingest Architectures](https://www.elastic.co/docs/manage-data/ingest/ingest-reference-architectures) documentation.
75+
76+
77+
## Reference
78+
79+
### Inputs used
80+
81+
This package uses the [HTTP Check Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/httpcheckreceiver/README.md) of the OTel collector.
82+
83+
84+
85+
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)