Skip to content
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

TLS insecure setting is not working for otelcol.receiver.otlp #684

Closed
zoligorbe opened this issue Apr 26, 2024 · 2 comments
Closed

TLS insecure setting is not working for otelcol.receiver.otlp #684

zoligorbe opened this issue Apr 26, 2024 · 2 comments
Labels
bug Something isn't working frozen-due-to-age

Comments

@zoligorbe
Copy link

What's wrong?

Hey guys,

It seems that despite the documentation mentions it:

To disable tls for connections to the server, set the insecure argument to true.

the component does not support this, as Alloy throws when this setting is added:

Error: /etc/alloy/config.alloy:38:13: unrecognized attribute name "insecure"

37 |         tls {
38 |             insecure = true
   |             ^^^^^^^^^^^^^^^
39 |         }

ts=2024-04-26T10:04:40.241723879Z level=error msg="failed to start reporter" err="context canceled"
Error: could not perform the initial load successfully

I think it is only supported for client, but I am not that fluent with go 😅.

Anyway, if you can provide me a way to lunch the receiver with HTTP only, that would be awesome 🙏

Steps to reproduce

Execute the following command while providing the configuration (see below).

docker run \
  -v <CONFIG_FILE_PATH>:/etc/alloy/config.alloy \
  -p 12345:12345 \
  grafana/alloy:latest \
    run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data \
    /etc/alloy/config.alloy

System information

macOS Sonoma 14.4.1 (arm64)

Software version

v1.0.0 (sha256:21248ad12831ad8f7279eb40ecd161b2574c2194ca76e7413996666d09beef6c)

Configuration

otelcol.receiver.otlp "default" {
    http {
        endpoint = "0.0.0.0:4318"
        traces_url_path = "/v1/traces"
        metrics_url_path = "/v1/metrics"
        logs_url_path = "/v1/logs"

        tls {
            insecure = true
        }
    }

    output {
        //logs = [otelcol.exporter.loki.default.input]
        //metrics = [otelcol.exporter.prometheus.default.input]
        //traces = [otelcol.exporter.otlp.jaeger.input]
    }
}

Logs

ts=2024-04-26T10:27:56.559022553Z level=info "boringcrypto enabled"=false
ts=2024-04-26T10:27:56.55903822Z level=info msg="running usage stats reporter"
ts=2024-04-26T10:27:56.559041011Z level=info msg="starting complete graph evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918
ts=2024-04-26T10:27:56.559049303Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=logging duration=28.292µs
ts=2024-04-26T10:27:56.559059053Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=labelstore duration=4.625µs
ts=2024-04-26T10:27:56.559064053Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=tracing duration=1.541µs
ts=2024-04-26T10:27:56.559068136Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=otel duration=417ns
ts=2024-04-26T10:27:56.559075886Z level=info msg="applying non-TLS config to HTTP server" service=http
ts=2024-04-26T10:27:56.55907872Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=http duration=7.042µs
ts=2024-04-26T10:27:56.559082511Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=cluster duration=250ns
ts=2024-04-26T10:27:56.559086386Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=ui duration=541ns
ts=2024-04-26T10:27:56.559132386Z level=error msg="failed to evaluate config" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node=otelcol.receiver.otlp.default err="decoding configuration: /etc/alloy/config.alloy:9:13: unrecognized attribute name \"insecure\""
ts=2024-04-26T10:27:56.559144136Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=otelcol.receiver.otlp.default duration=51.791µs

ts=2024-04-26T10:27:56.559168928Z level=info msg="finished node evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 node_id=remotecfg duration=20.917µs
ts=2024-04-26T10:27:56.559178636Z level=info msg="finished complete graph evaluation" controller_path=/ controller_id="" trace_id=df1ee8ccaa70ca70f168ab0c4228a918 duration=190.708µs
Error: /etc/alloy/config.alloy:9:13: unrecognized attribute name "insecure"

 8 |         tls {
 9 |             insecure = true
   |             ^^^^^^^^^^^^^^^
10 |         }
ts=2024-04-26T10:27:56.55927097Z level=error msg="failed to start reporter" err="context canceled"
Error: could not perform the initial load successfully
@zoligorbe zoligorbe added the bug Something isn't working label Apr 26, 2024
@tpaschalis
Copy link
Member

Hey there 👋

We've fixed the documentation on main with this commit, but forgot to backport it to the latest release.

If you look for /next, the correct docs are up: https://grafana.com/docs/alloy/next/reference/components/otelcol.receiver.otlp/#tls-block

@zoligorbe
Copy link
Author

Hey @tpaschalis 👋

Since it was not working with the insecure = true attribute, I commented it out. After opening this issue, I removed the whole tls block and it started working.. I couldn't figure out what was the solution, what made it work, but now I understand it.
Essentially, I've defined an empty tls block by commenting out the insecure part, which turned the HTTPS on 🤦

Thank you very much for your answer, the new documentation definitely made it clear.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

2 participants