This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default disable tracing some ai events (#38)
* Default disable tracing some ai events * Fix checkstyle issue * Add switch for restart trace
- Loading branch information
Showing
7 changed files
with
74 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
InstrumentationKey=@instrkey@ | ||
InstrumentationKey=@instrkey@ | ||
EnableAzureApiTrace=@enableAzureApiTrace@ | ||
EnablePageDecorator=@enablePageDecorator@ | ||
EnableRestartTrace=@enableRestartTrace@ | ||
FilteredEvents=@filteredEvents@ |
50 changes: 50 additions & 0 deletions
50
...mmons-plugin/src/main/java/com/microsoft/jenkins/azurecommons/telemetry/AiProperties.java
This file contains 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,50 @@ | ||
package com.microsoft.jenkins.azurecommons.telemetry; | ||
|
||
import java.io.IOException; | ||
import java.util.Properties; | ||
import java.util.logging.Logger; | ||
|
||
public final class AiProperties { | ||
private static final Logger LOGGER = Logger.getLogger(AiProperties.class.getName()); | ||
private static final String INSTRUMENTATION_KEY_NAME = "InstrumentationKey"; | ||
private static final String ENABLE_AZURE_API_TRACE_NAME = "EnableAzureApiTrace"; | ||
private static final String ENABLE_PAGE_DECORATOR_NAME = "EnablePageDecorator"; | ||
private static final String ENABLE_RESTART_TRACE_NAME = "EnableRestartTrace"; | ||
private static final String FILTERED_EVENTS_NAME = "FilteredEvents"; | ||
|
||
private static final Properties PROP = new Properties(); | ||
|
||
static { | ||
try { | ||
PROP.load(AiProperties.class.getClassLoader().getResourceAsStream("ai.properties")); | ||
} catch (IOException e) { | ||
LOGGER.severe("Failed to load Ai property file."); | ||
} | ||
} | ||
|
||
public static String getInstrumentationKey() { | ||
return PROP.getProperty(INSTRUMENTATION_KEY_NAME); | ||
} | ||
|
||
public static boolean enableAzureApiTrace() { | ||
String property = PROP.getProperty(ENABLE_AZURE_API_TRACE_NAME); | ||
return Boolean.parseBoolean(property); | ||
} | ||
|
||
public static boolean enablePageDecorator() { | ||
String property = PROP.getProperty(ENABLE_PAGE_DECORATOR_NAME); | ||
return Boolean.parseBoolean(property); | ||
} | ||
|
||
public static boolean enableRestartTrace() { | ||
String property = PROP.getProperty(ENABLE_RESTART_TRACE_NAME); | ||
return Boolean.parseBoolean(property); | ||
} | ||
|
||
public static String getFilteredEvents() { | ||
return PROP.getProperty(FILTERED_EVENTS_NAME); | ||
} | ||
|
||
private AiProperties() { | ||
} | ||
} |
This file contains 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 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 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 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