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

[Integration][Kafka] Add consumer groups #1333

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 139 additions & 84 deletions integrations/kafka/.port/resources/blueprints.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,151 @@
[
{
"identifier": "kafkaCluster",
"title": "Cluster",
"icon": "Kafka",
"schema": {
"properties": {
"controllerId": {
"title": "Controller ID",
"type": "string"
"identifier":"kafkaCluster",
"title":"Cluster",
"icon":"Kafka",
"schema":{
"properties":{
"controllerId":{
"title":"Controller ID",
"type":"string"
}
}
}
}
}
},
{
"identifier": "kafkaBroker",
"title": "Broker",
"icon": "Kafka",
"schema": {
"properties": {
"address": {
"title": "Address",
"type": "string"
},
"region": {
"title": "Region",
"type": "string"
},
"version": {
"title": "Version",
"type": "string"
},
"config": {
"title": "Config",
"type": "object"
"identifier":"kafkaBroker",
"title":"Broker",
"icon":"Kafka",
"schema":{
"properties":{
"address":{
"title":"Address",
"type":"string"
},
"region":{
"title":"Region",
"type":"string"
},
"version":{
"title":"Version",
"type":"string"
},
"config":{
"title":"Config",
"type":"object"
}
}
},
"relations":{
"cluster":{
"target":"kafkaCluster",
"required":true,
"many":false
}
}
},
"relations": {
"cluster": {
"target": "kafkaCluster",
"required": true,
"many": false
}
}
}
},
{
"identifier": "kafkaTopic",
"title": "Topic",
"icon": "Kafka",
"schema": {
"properties": {
"replicas": {
"title": "Replicas",
"type": "number"
},
"partitions": {
"title": "Partitions",
"type": "number"
},
"compaction": {
"title": "Compaction",
"type": "boolean"
},
"retention": {
"title": "Retention",
"type": "boolean"
},
"deleteRetentionTime": {
"title": "Delete Retention Time",
"type": "number"
},
"partitionsMetadata": {
"title": "Partitions Metadata",
"type": "array"
"identifier":"kafkaTopic",
"title":"Topic",
"icon":"Kafka",
"schema":{
"properties":{
"replicas":{
"title":"Replicas",
"type":"number"
},
"partitions":{
"title":"Partitions",
"type":"number"
},
"compaction":{
"title":"Compaction",
"type":"boolean"
},
"retention":{
"title":"Retention",
"type":"boolean"
},
"deleteRetentionTime":{
"title":"Delete Retention Time",
"type":"number"
},
"partitionsMetadata":{
"title":"Partitions Metadata",
"type":"array"
},
"config":{
"title":"Config",
"type":"object"
}
}
},
"relations":{
"cluster":{
"target":"kafkaCluster",
"required":true,
"many":false
},
"config": {
"title": "Config",
"type": "object"
"brokers":{
"target":"kafkaBroker",
"required":false,
"many":true
}
}
},
{
phalbert marked this conversation as resolved.
Show resolved Hide resolved
"identifier":"kafkaConsumerGroup",
"title":"Consumer Group",
"icon":"Kafka",
"schema":{
"properties":{
"state":{
"title":"State",
"type":"string",
"description":"The current state of the consumer group."
},
"members":{
"title":"Members",
"type":"array",
"description":"List of members in the consumer group.",
"items":{
"type":"object"
}
},
"coordinator":{
"title":"Coordinator",
"type":"number",
"description":"Broker ID of the coordinator for the consumer group."
},
"partition_assignor":{
"title":"Partition Assignor",
"type":"string",
"description":"Strategy used to assign partitions to consumers."
},
"is_simple_consumer_group":{
"title":"Is Simple Consumer Group",
"type":"boolean",
"description":"Indicates if the group is a simple consumer group."
},
"authorized_operations":{
"title":"Authorized Operations",
"type":"array",
"description":"List of operations authorized for the consumer group.",
"items":{
"type":"string"
}
}
}
},
"calculationProperties":{

},
"relations":{
"cluster":{
"target":"kafkaCluster",
"required":true,
"many":false
}
}
},
"relations": {
"cluster": {
"target": "kafkaCluster",
"required": true,
"many": false
},
"brokers": {
"target": "kafkaBroker",
"required": false,
"many": true
}
}
}
}
]
18 changes: 18 additions & 0 deletions integrations/kafka/.port/resources/port-app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,21 @@ resources:
relations:
cluster: .cluster_name
brokers: '[.cluster_name + "_" + (.partitions[].replicas[] | tostring)] | unique'
- kind: consumer_group
selector:
query: 'true'
port:
entity:
mappings:
identifier: .cluster_name + "_" + .group_id
title: .group_id
blueprint: '"kafkaConsumerGroup"'
properties:
state: .state
members: .members
coordinator: .coordinator.id
partition_assignor: .partition_assignor
is_simple_consumer_group: .is_simple_consumer_group
authorized_operations: .authorized_operations
relations:
cluster: .cluster_name
1 change: 1 addition & 0 deletions integrations/kafka/.port/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ features:
- kind: cluster
- kind: broker
- kind: topic
- kind: consumer_group
saas:
enabled: false
configurations:
Expand Down
8 changes: 8 additions & 0 deletions integrations/kafka/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- towncrier release notes start -->

## 0.1.111 (2025-01-20)


### Improvements

- Added support for ingesting consumer groups


## 0.1.110 (2025-01-19)


Expand Down
36 changes: 36 additions & 0 deletions integrations/kafka/examples/consumer_groups.entity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"blueprint": "kafkaConsumerGroup",
"identifier": "local-cluster_conduktor_gateway",
"createdAt": "2025-01-17T14:23:38.182Z",
"updatedBy": "<port-client-id>",
"createdBy": "<port-client-id>",
"icon": null,
"team": [],
"title": "conduktor_gateway",
"relations": {
"cluster": "local-cluster"
},
"properties": {
"partition_assignor": "range",
"coordinator": null,
"authorized_operations": null,
"is_simple_consumer_group": false,
"members": [
{
"assignment": {
"topic_partitions": [
{
"partition": 0,
"topic": "_conduktor_gateway_license"
}
]
},
"host": "172.23.0.6",
"id": "conduktor-gateway_6969-707254dd-d7d6-4e34-9ac9-d868d5fd5f56",
"client_id": "conduktor-gateway_6969"
}
],
"state": "STABLE"
},
"updatedAt": "2025-01-17T14:23:38.182Z"
}
phalbert marked this conversation as resolved.
Show resolved Hide resolved
24 changes: 24 additions & 0 deletions integrations/kafka/examples/consumer_groups.response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"group_id": "_confluent-ksql-default_query_CTAS_PURCHASE_PER_PRODUCT_0",
"state": "EMPTY",
"members": [
{
"assignment": {
"topic_partitions": [
{
"partition": 0,
"topic": "_conduktor_gateway_license"
}
]
},
"host": "172.23.0.6",
"id": "conduktor-gateway_6969-707254dd-d7d6-4e34-9ac9-d868d5fd5f56",
"client_id": "conduktor-gateway_6969"
}
],
"cluster_name": "local-cluster",
"coordinator": 0,
"partition_assignor": "range",
"is_simple_consumer_group": false,
"authorized_operations": null
}
phalbert marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading