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

Remove support for Kafka 0.8 #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ Metrics can be filtered based on the metric name and the metric dimensions (min,
## Supported Kafka versions

- For Kafka `0.9.0.0` or later use `kafka-statsd-metrics2-0.5.0`
- For Kafka `0.8.2.0` or later use `kafka-statsd-metrics2-0.4.0`
- For Kafka `0.8.1.1` or prior use `kafka-statsd-metrics2-0.3.0`


## Releases

### 0.5.5
- - Remove support for Kafka v0.8.

### 0.5.4
- Fix metrics with different tags not reported properly

Expand Down Expand Up @@ -58,7 +59,7 @@ Metrics can be filtered based on the metric name and the metric dimensions (min,
- Install the jar in Kafka classpath, typically `./kafka_2.11-0.9.0.1/libs/`
- In the Kafka config file, `server.properties`, add the following properties. Default values are in parenthesis.

## How to use metrics in Kafka 0.9 / 0.8?
## How to use metrics in Kafka 0.9?
### New metrics in kafka 0.9

1. Add `metric.reporters` in producer.properties or consumer.properties
Expand All @@ -74,23 +75,6 @@ Producer:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --new-consumer --zookeeper localhost:2181 --topic test -from-beginning --consumer.config config/consumer.properties
```

### Old metrics in kafka 0.8

1. Add `kafka.metrics.reporters` in producer.properties or consumer.properties
```bash
# declare the reporter if old producer/consumer is used
kafka.metrics.reporters=com.airbnb.kafka.kafka08.StatsdMetricsReporter
```
2. Run old-producer or old-consumer

```bash
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test --producer.config config/producer.properties --old-producer
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --zookeeper localhost:2181 --topic test -from-beginning --consumer.config config/consumer.properties
```

2. Run old-consumer


### Configurations
```bash
# declare the reporter if new producer/consumer is used
Expand Down
31 changes: 6 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
defaultTasks 'build'

group = 'com.airbnb'
description = 'StatsD Support for Kafka Metrics (kafka version: 0.8 and 0.9)'
description = 'StatsD Support for Kafka Metrics (kafka version: 0.9)'

repositories {
mavenCentral()
Expand All @@ -18,7 +18,7 @@ repositories {
ext {
defaultKafkaVersion = '0.9.0.1'
kafkaVersion = project.getProperties().getOrDefault("kafkaVersion", defaultKafkaVersion)
kafkaVersionsToTest = ['0.8.2.2', '0.9.0.1', '0.10.2.2', '1.1.1', '2.3.1']
kafkaVersionsToTest = ['0.9.0.1', '0.10.2.2', '1.1.1', '2.3.1']

testWithKafkaClient = project.getProperties().getOrDefault("testWithKafkaClient", false)
kafkaClientVersionsToTest = ['0.9.0.1', '0.10.2.2', '1.1.1', '2.3.1']
Expand All @@ -27,18 +27,12 @@ ext {
dependencies {
compile 'com.indeed:java-dogstatsd-client:2.0.11'

if (testWithKafkaClient) {
compileOnly "org.apache.kafka:kafka-clients:${kafkaVersion}"
} else {
compileOnly "org.apache.kafka:kafka_2.11:${defaultKafkaVersion}"
}
compileOnly "org.apache.kafka:kafka-clients:${kafkaVersion}"
compileOnly 'com.yammer.metrics:metrics-core:2.2.0'
compileOnly 'org.slf4j:slf4j-log4j12:+'

if (testWithKafkaClient) {
testCompile "org.apache.kafka:kafka-clients:${kafkaVersion}"
} else {
testCompile "org.apache.kafka:kafka_2.11:${kafkaVersion}"
}
testCompile "org.apache.kafka:kafka-clients:${kafkaVersion}"
testCompile 'com.yammer.metrics:metrics-core:2.2.0'
testCompile 'org.slf4j:slf4j-log4j12:+'
testCompile 'junit:junit:4.11'
testCompile 'org.easymock:easymock:3.2'
Expand All @@ -61,29 +55,16 @@ def excludeFromCompile(Task task, Map<String, List<String>> excludeMap) {

if (testWithKafkaClient) {
def srcExcludes = [
"com/airbnb/kafka/kafka08/": ["**/*"],
"com/airbnb/metrics/": ["ExcludeMetricPredicate", "MetricNameFormatter", "Parser", "ParserForNoTag", "ParserForTagInMBeanName", "StatsDReporter"]
]
def testExcludes = [
"com/airbnb/kafka/kafka08/": ["**/*"],
"com/airbnb/metrics/": ["DimensionTest", "ExcludeMetricPredicateTest", "MetricNameFormatterTest", "ParserTest", "StatsDReporterTest"]
]

excludeFromCompile(compileJava, srcExcludes)
excludeFromCompile(compileTestJava, testExcludes)
}

configurations {
// manually excludes some unnecessary dependencies
compile.exclude module: 'zookeeper'
compile.exclude module: 'zkclient'
compile.exclude module: 'javax'
compile.exclude module: 'jline'
compile.exclude module: 'jms'
compile.exclude module: 'jmxri'
compile.exclude module: 'jmxtools'
compile.exclude module: 'mail'
}

shadowJar {
exclude 'META-INF/*.DSA'
Expand Down
152 changes: 0 additions & 152 deletions src/main/java/com/airbnb/kafka/kafka08/StatsdMetricsReporter.java

This file was deleted.

This file was deleted.

This file was deleted.