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

api: add the role implementation #8

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

oleg-jukovec
Copy link
Contributor

@oleg-jukovec oleg-jukovec commented Jul 8, 2024

The role is generally similar in functionality to cartridge-metrics-role. But there is also a difference. The key difference - the role does not support health format.

The role name is roles.metrics-export it could be configured in the Tarantool 3 cluster configuration like this:

roles: [roles.metrics-export]
roles_cfg:
  roles.metrics-export:
    http:
    - listen: 8081
      endpoints:
      - path: /metrics/json
        format: json
      - path: /metrics/prometheus/
        format: prometheus
    - listen: '127.0.0.1:8082'
      endpoints:
      - path: /metrics/prometheus
        format: prometheus
      - path: /metrics/json/
        format: json
  • http - is an export type name. The http is only supported at now. It allows to export metrics via a list of HTTP servers.
    • listen - is an address/port to listen via a HTTP server.
    • endpoints - is a list of endpoints to share via the HTTP server.
      • path - is an endpoint path.
      • format - is an export format for the endpoint, at now the role supports only json and prometheus.

Closes #6

@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/gh-6-role-implementation branch from 4b84ec4 to 5cfab2d Compare July 9, 2024 13:28
@oleg-jukovec oleg-jukovec changed the title wip: add a role api: add the role implementation Jul 9, 2024
@oleg-jukovec oleg-jukovec marked this pull request as ready for review July 9, 2024 13:30
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/gh-6-role-implementation branch from 5cfab2d to 9d6d180 Compare July 9, 2024 13:33
test/entrypoint/config.yaml Show resolved Hide resolved
test/entrypoint/config.yaml Outdated Show resolved Hide resolved
roles/metrics-export.lua Show resolved Hide resolved
roles/metrics-export.lua Outdated Show resolved Hide resolved
roles/metrics-export.lua Outdated Show resolved Hide resolved
roles/metrics-export.lua Outdated Show resolved Hide resolved
test/integration/role_test.lua Outdated Show resolved Hide resolved
test/unit/http_test.lua Show resolved Hide resolved
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/gh-6-role-implementation branch 7 times, most recently from c583fb7 to 707dc32 Compare July 10, 2024 06:58
Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

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

Seems cool, thank you!

The role is generally similar in functionality to
`cartridge-metrics-role`. But there is also a difference. The key
difference - the role does not support `health` format.

The role name is `roles.metrics-export` it could be configured in the
Tarantool 3 cluster configuration like this:

```yaml
roles: [roles.metrics-export]
roles_cfg:
  roles.metrics-export:
    http:
    - listen: 8081
      endpoints:
      - path: /metrics/json
        format: json
      - path: /metrics/prometheus/
        format: prometheus
    - listen: '127.0.0.1:8082'
      endpoints:
      - path: /metrics/prometheus
        format: prometheus
      - path: /metrics/json/
        format: json
```

* `http` - is an export type name. The `http` is only supported at
  now. It allows to export metrics via a list of HTTP servers.
  * `listen` - is an address/port to listen via a HTTP server.
  * `endpoints` - is a list of endpoints to share via the HTTP server.
    * `path` - is an endpoint path.
    * `format` - is an export format for the endpoint, at now the role
      supports only `json` and `prometheus`.

Closes #6
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/gh-6-role-implementation branch from 707dc32 to 69c7606 Compare July 10, 2024 08:44
Copy link
Contributor

@better0fdead better0fdead left a comment

Choose a reason for hiding this comment

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

Hi, thx for patch!

@better0fdead better0fdead merged commit 0c52e44 into master Jul 11, 2024
3 checks passed
@better0fdead better0fdead deleted the oleg-jukovec/gh-6-role-implementation branch July 11, 2024 09:28
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

Successfully merging this pull request may close these issues.

role: the implementation
3 participants