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

[core.metrics] remove process field #115200

Closed
wants to merge 2 commits into from

Conversation

Bamieh
Copy link
Member

@Bamieh Bamieh commented Oct 15, 2021

Remove deprecated process field in favor of the processes field. This change is needed for the future when we start supporting multi-process Kibana instances.

For now metrics reporting the process field simply unwrap the first process in the array. In the future once we have multi-processes in Kibana we'll add more sophisticated logic to unwrap those values.

Related work: #113149
Closes #104124

@Bamieh Bamieh added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Oct 15, 2021
@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 15, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Jest Tests.src/core/server/metrics.MetricsService #start invokes setInterval with the configured interval

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: Cannot read property '0' of undefined
    at getEcsOpsMetricsLog (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/logging/get_ops_metrics_log.ts:20:28)
    at MetricsService.refreshMetrics (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.ts:77:31)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at MetricsService.setup (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.ts:51:5)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.test.ts:46:7)

Jest Tests.src/core/server/metrics.MetricsService #start collects the metrics at every interval

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: Cannot read property '0' of undefined
    at getEcsOpsMetricsLog (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/logging/get_ops_metrics_log.ts:20:28)
    at MetricsService.refreshMetrics (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.ts:77:31)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at MetricsService.setup (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.ts:51:5)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.test.ts:56:7)

Jest Tests.src/core/server/metrics.MetricsService #start resets the collector after each collection

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: Cannot read property '0' of undefined
    at getEcsOpsMetricsLog (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/logging/get_ops_metrics_log.ts:20:28)
    at MetricsService.refreshMetrics (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.ts:77:31)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at MetricsService.setup (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.ts:51:5)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/core/server/metrics/metrics_service.test.ts:71:7)

and 8 more failures, only showing the first 3.

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 302.8KB 302.8KB +10.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@matschaffer
Copy link
Contributor

matschaffer commented Oct 27, 2021

@Bamieh I'm checking this out as part of #113149

I can see the new processes section via yarn start but it only has one process.

"processes": [
    {
      "memory": {
        "heap": {
          "total_bytes": 648167424,
          "used_bytes": 541059880,
          "size_limit": 4345298944
        },
        "resident_set_size_bytes": 315817984
      },
      "pid": 18146,
      "event_loop_delay": 11558807.461716937,
      "event_loop_delay_histogram": {
        "min": 9207808,
        "max": 13844479,
        "mean": 11558807.461716937,
        "exceeds": 0,
        "stddev": 1096233.3530730233,
        "from_timestamp": "2021-10-27T07:04:46.678Z",
        "last_updated_at": "2021-10-27T07:04:51.678Z",
        "percentiles": {
          "50": 11862015,
          "75": 12550143,
          "95": 12795903,
          "99": 13377535
        }
      },
      "uptime_ms": 2247843.446167
    }
  ],

Is there a flag I can use to spawn multiple process for better exploratory testing?

@Bamieh
Copy link
Member Author

Bamieh commented Nov 9, 2021

@matschaffer Sorry the message was lost in between kibanamachine messages. Currently, we do not have more than 1 process. This is a preparatory work for enabling multi-processes in kibana. So I think your best option is to fake the response to have multiple ones for now

@matschaffer
Copy link
Contributor

Sweet. That lines up with what I'm working on in #117615

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not do this and do #119560 instead.

@spalger spalger added v7.17.0 and removed v7.16.0 labels Dec 7, 2021
@Bamieh Bamieh closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v7.17.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Breaking][core.metrics] Remove process field from ops metrics & /stats API
4 participants