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

Tomcat module does not support HTTPS #16720

Closed
wolframhaussig opened this issue Mar 2, 2020 · 1 comment
Closed

Tomcat module does not support HTTPS #16720

wolframhaussig opened this issue Mar 2, 2020 · 1 comment

Comments

@wolframhaussig
Copy link

Created from: https://discuss.elastic.co/t/metricbeat-tomcat-module-with-https/220313/1

I tried to setup MetricBeat 7.6.0 to get tomcat metrics from a tomcat 8.0.51. Both processes are running on the same server(RedHat enterprise linux 6.10).

I configured the tomcat module:

- module: tomcat
  metricsets: ['threading', 'cache', 'memory', 'requests']
  period: 10s
  hosts: ['https://myhost.mycompany.com:8443']
  ssl.certificate_authorities: ["/home/tomcat/metricbeat/intermediate.crt","/home/tomcat/metricbeat/root.crt"]
  path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
  username: "metricbeat"
  password: "${tomcat.password}"

MetricBeat starts with this config but it reports the following error:

2020-02-21T08:35:16.881+0100 INFO module/wrapper.go:252 Error fetching data for metricset tomcat.threading: error making http request: Post http://myhost.mycompany.com:8443/jolokia/%3FignoreErrors=true&canonicalNaming=false: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x03\x00\x02\x02P"

It seems to overwrite my https in the url. I tried the jolokia module and it worked well with the following config:

- module: jolokia
  metricsets: ["jmx"]
  period: 10s
  hosts: ['https://myhost.mycompany.com:8443']
  namespace: "metrics"
  path: "/jolokia/?ignoreErrors=true&canonicalNaming=false"
  username: "metricbeat"
  password: "${tomcat.password}"
  ssl.certificate_authorities: ["/home/tomcat/metricbeat/intermediate.crt","/home/tomcat/metricbeat/root.crt"]
  jmx.mappings:
    - mbean: 'java.lang:type=Runtime'
      attributes:
        - attr: Uptime
          field: uptime
    - mbean: 'java.lang:type=Memory'
      attributes:
        - attr: HeapMemoryUsage
          field: memory.heap_usage
        - attr: NonHeapMemoryUsage
          field: memory.non_heap_usage
    # GC Metrics - this depends on what is available on your JVM
    - mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
      attributes:
        - attr: CollectionTime
          field: gc.cms_collection_time
        - attr: CollectionCount
          field: gc.cms_collection_count

  jmx.application:
  jmx.instance:

Is there something different to configure when using HTTPS?

Best regards
Wolfram

@jsoriano
Copy link
Member

jsoriano commented Mar 2, 2020

Hey @wolframhaussig,

I think this is the same issue as the one fixed in: #16205

Fix will be released in 7.7.0.

Thanks for reporting this issue.

@jsoriano jsoriano closed this as completed Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants