-
Notifications
You must be signed in to change notification settings - Fork 315
Move request ID generator configuration to polaris.tracing #2757
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -137,7 +137,6 @@ polaris.event-listener.type=no-op | |||||
# polaris.event-listener.persistence-in-memory-buffer.buffer-time=5000ms | ||||||
# polaris.event-listener.persistence-in-memory-buffer.max-buffer-size=5 | ||||||
|
||||||
polaris.log.request-id-header-name=Polaris-Request-Id | ||||||
# polaris.log.mdc.aid=polaris | ||||||
# polaris.log.mdc.sid=polaris-service | ||||||
|
||||||
|
@@ -146,6 +145,9 @@ polaris.metrics.tags.application=Polaris | |||||
# polaris.metrics.tags.environment=prod | ||||||
# polaris.metrics.tags.region=us-west-2 | ||||||
|
||||||
polaris.tracing.request-id-generator.type=default | ||||||
polaris.tracing.request-id-generator.header-name=Polaris-Request-Id | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor / optional : does the header name has to to do anything with the generator, wondering if we just reuse the name we had earlier, WDYT ?
Suggested change
|
||||||
|
||||||
# polaris.tasks.max-concurrent-tasks=100 | ||||||
# polaris.tasks.max-queued-tasks=1000 | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.config; | ||
|
||
import io.smallrye.config.RelocateConfigSourceInterceptor; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ConfigRelocationInterceptor extends RelocateConfigSourceInterceptor { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigRelocationInterceptor.class); | ||
|
||
public ConfigRelocationInterceptor() { | ||
super(ConfigRelocationInterceptor::applyRelocations); | ||
} | ||
|
||
private static String applyRelocations(String name) { | ||
if (name.equals("polaris.log.request-id-header-name")) { | ||
String replacement = "polaris.tracing.request-id-generator.header-name"; | ||
LOGGER.warn("Property '{}' is deprecated, use '{}' instead", name, replacement); | ||
return replacement; | ||
} | ||
return name; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.polaris.service.tracing; | ||
|
||
import io.smallrye.config.ConfigMapping; | ||
|
||
@ConfigMapping(prefix = "polaris.tracing") | ||
public interface TracingConfiguration { | ||
|
||
RequestIdGenerator requestIdGenerator(); | ||
|
||
interface RequestIdGenerator { | ||
|
||
/** | ||
* The type of the request ID generator. Must be a registered {@link RequestIdGenerator} | ||
* identifier. | ||
*/ | ||
String type(); | ||
|
||
/** | ||
* The name of the request header that contains the request ID. Used by the default request ID | ||
* generator. | ||
*/ | ||
String headerName(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
org.apache.polaris.service.config.ConfigRelocationInterceptor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit : newline ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use word deperecated ?