-
Notifications
You must be signed in to change notification settings - Fork 115
Rashmi/fix prom telemetry #247
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bbd4fa5
fix prom telemetry
a158a1c
changes
2b2bb67
changes
97f3247
changes
7e0286e
changes
bfbbec3
changes
9acbb92
changes
6a061e3
changes
985db50
changes
937117f
changes
227b827
changes
7972485
changes
56ed2c0
changes
cd9152b
changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!/usr/local/bin/ruby | ||
|
|
||
| @td_agent_bit_conf_path = "/etc/opt/microsoft/docker-cimprov/td-agent-bit.conf" | ||
|
|
||
| @default_service_interval = "15" | ||
|
|
||
| def is_number?(value) | ||
| true if Integer(value) rescue false | ||
| end | ||
|
|
||
| def substituteFluentBitPlaceHolders | ||
| begin | ||
| # Replace the fluentbit config file with custom values if present | ||
| puts "config::Starting to substitute the placeholders in td-agent-bit.conf file for log collection" | ||
|
|
||
| interval = ENV["FBIT_SERVICE_FLUSH_INTERVAL"] | ||
| bufferChunkSize = ENV["FBIT_TAIL_BUFFER_CHUNK_SIZE"] | ||
| bufferMaxSize = ENV["FBIT_TAIL_BUFFER_MAX_SIZE"] | ||
|
|
||
| serviceInterval = (!interval.nil? && is_number?(interval)) ? interval : @default_service_interval | ||
| serviceIntervalSetting = "Flush " + serviceInterval | ||
|
|
||
| tailBufferChunkSize = (!bufferChunkSize.nil? && is_number?(bufferChunkSize)) ? bufferChunkSize : nil | ||
|
|
||
| tailBufferMaxSize = (!bufferMaxSize.nil? && is_number?(bufferMaxSize)) ? bufferMaxSize : nil | ||
|
|
||
| text = File.read(@td_agent_bit_conf_path) | ||
| new_contents = text.gsub("${SERVICE_FLUSH_INTERVAL}", serviceIntervalSetting) | ||
| if !tailBufferChunkSize.nil? | ||
| new_contents = new_contents.gsub("${TAIL_BUFFER_CHUNK_SIZE}", "Buffer_Chunk_Size " + tailBufferChunkSize + "m") | ||
| else | ||
| new_contents = new_contents.gsub("\n ${TAIL_BUFFER_CHUNK_SIZE}\n", "\n") | ||
| end | ||
| if !tailBufferMaxSize.nil? | ||
| new_contents = new_contents.gsub("${TAIL_BUFFER_MAX_SIZE}", "Buffer_Max_Size " + tailBufferMaxSize + "m") | ||
| else | ||
| new_contents = new_contents.gsub("\n ${TAIL_BUFFER_MAX_SIZE}\n", "\n") | ||
| end | ||
|
|
||
| File.open(@td_agent_bit_conf_path, "w") { |file| file.puts new_contents } | ||
| puts "config::Successfully substituted the placeholders in td-agent-bit.conf file" | ||
| rescue => errorStr | ||
| puts "td-agent-bit-config-customizer: error while substituting values: #{errorStr}" | ||
| end | ||
| end | ||
|
|
||
| substituteFluentBitPlaceHolders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.