-
Notifications
You must be signed in to change notification settings - Fork 511
New httpcheck OTel input package #15785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| Elastic License 2.0 | ||
|
|
||
| URL: https://www.elastic.co/licensing/elastic-license | ||
|
|
||
| ## Acceptance | ||
|
|
||
| By using the software, you agree to all of the terms and conditions below. | ||
|
|
||
| ## Copyright License | ||
|
|
||
| The licensor grants you a non-exclusive, royalty-free, worldwide, | ||
| non-sublicensable, non-transferable license to use, copy, distribute, make | ||
| available, and prepare derivative works of the software, in each case subject to | ||
| the limitations and conditions below. | ||
|
|
||
| ## Limitations | ||
|
|
||
| You may not provide the software to third parties as a hosted or managed | ||
| service, where the service provides users with access to any substantial set of | ||
| the features or functionality of the software. | ||
|
|
||
| You may not move, change, disable, or circumvent the license key functionality | ||
| in the software, and you may not remove or obscure any functionality in the | ||
| software that is protected by the license key. | ||
|
|
||
| You may not alter, remove, or obscure any licensing, copyright, or other notices | ||
| of the licensor in the software. Any use of the licensor’s trademarks is subject | ||
| to applicable law. | ||
|
|
||
| ## Patents | ||
|
|
||
| The licensor grants you a license, under any patent claims the licensor can | ||
| license, or becomes able to license, to make, have made, use, sell, offer for | ||
| sale, import and have imported the software, in each case subject to the | ||
| limitations and conditions in this license. This license does not cover any | ||
| patent claims that you cause to be infringed by modifications or additions to | ||
| the software. If you or your company make any written claim that the software | ||
| infringes or contributes to infringement of any patent, your patent license for | ||
| the software granted under these terms ends immediately. If your company makes | ||
| such a claim, your patent license ends immediately for work on behalf of your | ||
| company. | ||
|
|
||
| ## Notices | ||
|
|
||
| You must ensure that anyone who gets a copy of any part of the software from you | ||
| also gets a copy of these terms. | ||
|
|
||
| If you modify the software, you must include in any modified copies of the | ||
| software prominent notices stating that you have modified the software. | ||
|
|
||
| ## No Other Rights | ||
|
|
||
| These terms do not imply any licenses other than those expressly granted in | ||
| these terms. | ||
|
|
||
| ## Termination | ||
|
|
||
| If you use the software in violation of these terms, such use is not licensed, | ||
| and your licenses will automatically terminate. If the licensor provides you | ||
| with a notice of your violation, and you cease all violation of this license no | ||
| later than 30 days after you receive that notice, your licenses will be | ||
| reinstated retroactively. However, if you violate these terms after such | ||
| reinstatement, any additional violation of these terms will cause your licenses | ||
| to terminate automatically and permanently. | ||
|
|
||
| ## No Liability | ||
|
|
||
| *As far as the law allows, the software comes as is, without any warranty or | ||
| condition, and the licensor will not be liable to you for any damages arising | ||
| out of these terms or the use or nature of the software, under any kind of | ||
| legal claim.* | ||
|
|
||
| ## Definitions | ||
|
|
||
| The **licensor** is the entity offering these terms, and the **software** is the | ||
| software the licensor makes available under these terms, including any portion | ||
| of it. | ||
|
|
||
| **you** refers to the individual or entity agreeing to these terms. | ||
|
|
||
| **your company** is any legal entity, sole proprietorship, or other kind of | ||
| organization that you work for, plus all organizations that have control over, | ||
| are under the control of, or are under common control with that | ||
| organization. **control** means ownership of substantially all the assets of an | ||
| entity, or the power to direct its management and policies by vote, contract, or | ||
| otherwise. Control can be direct or indirect. | ||
|
|
||
| **your licenses** are all the licenses granted to you for the software under | ||
| these terms. | ||
|
|
||
| **use** means anything you do with the software requiring one of your licenses. | ||
|
|
||
| **trademark** means trademarks, service marks, and similar rights. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| {{- generatedHeader }} | ||
| {{/* | ||
| This template can be used as a starting point for writing documentation for your new integration. For each section, fill in the details | ||
| described in the comments. | ||
|
|
||
| Find more detailed documentation guidelines in https://www.elastic.co/docs/extend/integrations/documentation-guidelines | ||
| */}} | ||
| # HTTP Check Integration for Elastic | ||
|
|
||
| ## Overview | ||
| {{/* Complete this section with a short summary of what data this integration collects and what use cases it enables */}} | ||
| The HTTP Check integration for Elastic performs HTTP checks using the [HTTP check | ||
| receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/httpcheckreceiver/README.md) of the OTel Collector. | ||
|
|
||
| This integration can be used to monitor the availability of HTTP endpoints. | ||
|
|
||
| ### How it works | ||
| {{/* 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.*/}} | ||
| This integration performs periodic HTTP checks to the configured endpoints. | ||
|
|
||
| Apart from the endpoints, it is also possible to select the HTTP method and | ||
| headers to use in the requests. | ||
|
|
||
| ## What data does this integration collect? | ||
| {{/* Complete this section with information on what types of data the integration collects, and link to reference documentation if available */}} | ||
| This integration collects metrics with information about the | ||
| availability of the HTTP endpoints, and the status codes returned by requests. | ||
|
|
||
| Key metrics are stored under the metrics object, and they include: | ||
| | Metric Name | Description | Type | | ||
| |-------------|-------------|------| | ||
| | 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 | | ||
| | httpcheck.duration | Total duration of the request in milliseconds. | Gauge | | ||
|
|
||
| Documents for these metrics include attributes that follow [Semantic Conventions | ||
| for HTTP data](https://opentelemetry.io/docs/specs/semconv/http/). | ||
|
|
||
| ### Supported use cases | ||
| {{/* 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. */}} | ||
| This integration can be used to monitor the availability of HTTP endpoints. In a | ||
| more general sense, it can be used to perform requests to specific endpoints. | ||
|
|
||
| ## How do I deploy this integration? | ||
|
|
||
| ### Agent-based deployment | ||
|
|
||
| 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. | ||
|
|
||
| Elastic Agent is required to have network connectivity with the monitored | ||
| endpoints. | ||
|
|
||
| {{/* If agentless is available for this integration, we'll want to include that here as well. | ||
| ### Agentless deployment | ||
|
|
||
| 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. | ||
|
|
||
| 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) | ||
| */}} | ||
|
|
||
| ### Onboard / configure | ||
| {{/* List the steps that will need to be followed in order to completely set up a working integration. | ||
| For integrations that support multiple input types, be sure to add steps for all inputs. | ||
| */}} | ||
| This integration needs to be configured with the list of endpoints to monitor, | ||
| and the HTTP method and headers that should be used on the requests. | ||
|
|
||
| With each policy you can monitor multiple endpoints that require the same method | ||
| and headers. For example you can use a single policy to monitor multiple | ||
| endpoints if you only need to check its availability with the `GET` method. | ||
|
|
||
| In cases where different headers or methods are required, multiple policies must | ||
| be created, one for each combination of configurations. | ||
|
|
||
| ### Validation | ||
| {{/* How can the user test whether the integration is working? Including example commands or test files if applicable */}} | ||
| Once configured, you can find documents with information about the status code | ||
| of the requests done to the configured endpoints. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems). | ||
| {{/* | ||
| Add any vendor specific troubleshooting here. | ||
|
|
||
| Are there common issues or “gotchas” for deploying this integration? If so, how can they be resolved? | ||
| If applicable, links to the third-party software’s troubleshooting documentation. | ||
| */}} | ||
|
|
||
| ## Scaling | ||
|
|
||
| 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. | ||
| {{/* Add any vendor specific scaling information here */}} | ||
|
|
||
| ## Reference | ||
|
|
||
| ### Inputs used | ||
|
|
||
| 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. | ||
|
|
||
| {{/* All inputs used by this package will be automatically listed here. */}} | ||
| {{ inputDocs }} | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| version: '2.3' | ||
| services: | ||
| web: | ||
| image: nginx:1.29.0-alpine-slim | ||
| ports: | ||
| - 80 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| connectors: | ||
| forward: {} | ||
| exporters: | ||
| elasticsearch/componentid-0: | ||
| endpoints: | ||
| - https://elasticsearch:9200 | ||
| inputs: [] | ||
| output_permissions: | ||
| default: | ||
| _elastic_agent_checks: | ||
| cluster: | ||
| - monitor | ||
| _elastic_agent_monitoring: | ||
| indices: [] | ||
| uuid-for-permissions-on-related-indices: | ||
| indices: | ||
| - names: | ||
| - metrics-*-* | ||
| privileges: | ||
| - auto_configure | ||
| - create_doc | ||
| processors: | ||
| transform/componentid-0: | ||
| metric_statements: | ||
| - context: datapoint | ||
| statements: | ||
| - set(attributes["data_stream.type"], "metrics") | ||
| - set(attributes["data_stream.dataset"], "httpcheck.httpcheckreceiver") | ||
| - set(attributes["data_stream.namespace"], "ep") | ||
| receivers: | ||
| httpcheck/componentid-0: | ||
| collection_interval: 1m | ||
| targets: | ||
| - endpoints: | ||
| - https://epr.elastic.co | ||
| method: GET | ||
| secret_references: [] | ||
| service: | ||
| pipelines: | ||
| metrics: | ||
| exporters: | ||
| - elasticsearch/componentid-0 | ||
| receivers: | ||
| - forward | ||
| metrics/componentid-0: | ||
| exporters: | ||
| - forward | ||
| processors: | ||
| - transform/componentid-0 | ||
| receivers: | ||
| - httpcheck/componentid-0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| vars: | ||
| endpoints: | ||
| - https://epr.elastic.co | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test for input package is going to be if the policy is correctly formed ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This kind of test is available also for integration packages, is not specific to input packages.
System tests are the closest thing to a data related check that we have at the moment.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be clear, policy tests are not intended to collect any data, they only create a policy with some given variables and check that the generated agent policy is the expected one.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we consider them as a good to have for input packages.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, they could be used more broadly. They aren't more used now probably because they were introduced not so long ago and we haven't promoted them a lot. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| service: web | ||
| vars: | ||
| period: 1s | ||
| endpoints: | ||
| - http://{{Hostname}}:{{Port}} | ||
| assert: | ||
| min_count: 50 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| receivers: | ||
| httpcheck: | ||
| collection_interval: {{period}} | ||
| targets: | ||
| - method: {{method}} | ||
| endpoints: | ||
| {{#each endpoints}} | ||
| - {{this}} | ||
| {{/each}} | ||
| {{#if headers }} | ||
| headers: | ||
| {{#each headers}} | ||
| {{this}} | ||
| {{/each}} | ||
| {{/if}} | ||
|
|
||
| service: | ||
| pipelines: | ||
| metrics: | ||
| receivers: [httpcheck] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # newer versions go on top | ||
| - version: "0.1.0" | ||
| changes: | ||
| - description: Initial version of the package | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/15785 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| <!-- NOTICE: Do not edit this file manually.--> | ||
| <!-- This file is automatically generated by Elastic Package --> | ||
|
|
||
| # HTTP Check Integration for Elastic | ||
|
|
||
| ## Overview | ||
|
|
||
| The HTTP Check integration for Elastic performs HTTP checks using the [HTTP check | ||
| receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/httpcheckreceiver/README.md) of the OTel Collector. | ||
|
|
||
| This integration can be used to monitor the availability of HTTP endpoints. | ||
|
|
||
| ### How it works | ||
|
|
||
| This integration performs periodic HTTP checks to the configured endpoints. | ||
|
|
||
| Apart from the endpoints, it is also possible to select the HTTP method and | ||
| headers to use in the requests. | ||
|
|
||
| ## What data does this integration collect? | ||
|
|
||
| This integration collects metrics with information about the | ||
| availability of the HTTP endpoints, and the status codes returned by requests. | ||
|
|
||
| Key metrics are stored under the metrics object, and they include: | ||
| | Metric Name | Description | Type | | ||
| |-------------|-------------|------| | ||
| | 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 | | ||
| | httpcheck.duration | Total duration of the request in milliseconds. | Gauge | | ||
|
|
||
| Documents for these metrics include attributes that follow [Semantic Conventions | ||
| for HTTP data](https://opentelemetry.io/docs/specs/semconv/http/). | ||
|
|
||
| ### Supported use cases | ||
|
|
||
| This integration can be used to monitor the availability of HTTP endpoints. In a | ||
| more general sense, it can be used to perform requests to specific endpoints. | ||
|
|
||
| ## How do I deploy this integration? | ||
|
|
||
| ### Agent-based deployment | ||
|
|
||
| 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. | ||
|
|
||
| Elastic Agent is required to have network connectivity with the monitored | ||
| endpoints. | ||
|
|
||
|
|
||
|
|
||
| ### Onboard / configure | ||
|
|
||
| This integration needs to be configured with the list of endpoints to monitor, | ||
| and the HTTP method and headers that should be used on the requests. | ||
|
|
||
| With each policy you can monitor multiple endpoints that require the same method | ||
| and headers. For example you can use a single policy to monitor multiple | ||
| endpoints if you only need to check its availability with the `GET` method. | ||
|
|
||
| In cases where different headers or methods are required, multiple policies must | ||
| be created, one for each combination of configurations. | ||
|
|
||
| ### Validation | ||
|
|
||
| Once configured, you can find documents with information about the status code | ||
| of the requests done to the configured endpoints. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems). | ||
|
|
||
|
|
||
| ## Scaling | ||
|
|
||
| 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. | ||
|
|
||
|
|
||
| ## Reference | ||
|
|
||
| ### Inputs used | ||
|
|
||
| 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. | ||
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these componentid-0 ? Fetched from epr ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fleet generates this configuration with randomized component ids. Here elastic-package is replacing the random part with predictable strings so they can be compared in tests.