Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 0 additions & 5 deletions src/main/java/oracle/observability/ObservabilityExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ public PoolDataSource getPoolDataSource(String dataSourceName, boolean isScrapeB
} else {
if(dataSourceNameToDataSourceMap.containsKey(dataSourceName) && dataSourceNameToDataSourceMap.get(dataSourceName) != null)
return dataSourceNameToDataSourceMap.get(dataSourceName);

System.out.println("putting dataSourceName:" + dataSourceName + " isScrapeByName:" + isScrapeByName +
" ObservabilityExporter.dataSourceNameToDataSourceConfigMap.get(dataSourceName):"+
ObservabilityExporter.dataSourceNameToDataSourceConfigMap.get(dataSourceName));
PoolDataSource poolDataSource = isScrapeByName?
getDataSource(ObservabilityExporter.dataSourceNameToDataSourceConfigMap.get(dataSourceName))
:getDataSource(dataSourceName);
Expand Down Expand Up @@ -115,7 +111,6 @@ private PoolDataSource getDataSource(DataSourceConfig dataSourceConfig) throws S
private PoolDataSource getPoolDataSource(
String dataSourceName, String user, String pw, String serviceName, String tnsAdmin,
String vaultSecretOcid, String ociConfigFile, String ociProfile, String ociRegion, boolean isScrapeByName) throws SQLException {
System.out.println("getPoolDataSource dataSourceName = " + dataSourceName + ", user = " + user + ", pw = " + pw + ", serviceName = " + serviceName + ", vaultSecretOcid = " + vaultSecretOcid + ", ociConfigFile = " + ociConfigFile + ", ociProfile = " + ociProfile + ", ociRegion = " + ociRegion + ", isScrapeByName = " + isScrapeByName);
PoolDataSource poolDataSource = PoolDataSourceFactory.getPoolDataSource();
poolDataSource.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
String url = "jdbc:oracle:thin:@" + serviceName + "?TNS_ADMIN=" + tnsAdmin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public String scrapeByConfigName(@RequestParam("name") String name) throws Excep
@PostConstruct
public void init() throws Exception {
boolean isGlobalDataSourceSpecified = DATA_SOURCE_NAME != null && !DATA_SOURCE_NAME.trim().equals("");
boolean isMultiDataSourceConfigSpecified = MULTI_DATASOURCE_CONFIG != null || !MULTI_DATASOURCE_CONFIG.trim().equals("");
boolean isMultiDataSourceConfigSpecified = MULTI_DATASOURCE_CONFIG != null && !MULTI_DATASOURCE_CONFIG.trim().equals("");
if (!isMultiDataSourceConfigSpecified && !isGlobalDataSourceSpecified)
throw new Exception(
"Neither global datasource (DATA_SOURCE_NAME) nor multi-datasource (MULTI_DATASOURCE_CONFIG) " +
Expand Down